# How to calculate the angle of an arc expressed by a gp_Circ entity

#### bioan

Hi !
I try to construct an arc from a gp_Circ entity and I need to know the angle of the arc in radians.
How can I get it?

I appreciate your help with this issue!
Ioan

#### Quaoar

Staff member
@bioan The `gp_Circ` entity contains its placement and radius, but not parametric ranges. You are supposed to construct the `Geom_Circle` out of it, and trim this curve, e.g., with `Geom_TrimmedCurve` or by constructing an edge. Do you know the extremity points of your arc? If so, you might be asking how to get the angle from the known 3D points, but otherwise, it is always 360 degrees for the `gp_Circ` entity.

Anyway, if you share some more context, it will be easier to answer.

#### bioan

Thank you very much for your response!
I try to tessellate an arc which is constructed starting from its base circle and the angle of the arc expressed in radians.
I managed the resolve the arc value, but now I have a problem of construction when the value is a negative one.
This is my code:

double firstParam = 0;
double Step = (10* 2 * PI) / 360; // tessellate the arc with 10 degree step
double param = 0;​
gp_Pnt P1, P2;

P1 = ElCLib::Value(firstParam, myArc);
for (param = firstParam+Step; param < lastParam; param += Step)
{
P2 = ElCLib::Value(param, myArc);
P1 = P2;
}

This code is ok for a positive arc angle value, but when the value of the arc angle is negative the arc is constructed in the opposite side of it's center.

Any advice and suggestions are welcome and much appreciated!

#### Quaoar

Staff member
@bioan Which value do you tune to reproduce the problem?

Btw, you may want to look into the GCPnt package for discretization algorithms of OpenCascade.

#### bioan

• 