Returns the length of a circular arc segment.
120{
122 double radius_A, circumference_A;
123 int a2_side, clockwise;
124 double a1, a3;
125 double angle;
126
128 return 0.0;
129
131
132
133 if ( radius_A < 0 )
134 {
135 double dx = A1->
x - A3->
x;
136 double dy = A1->
y - A3->
y;
137 return sqrt(dx*dx + dy*dy);
138 }
139
140
141 circumference_A = M_PI * 2 * radius_A;
143 return circumference_A;
144
145
147
148
149
150 if ( a2_side == -1 )
152 else
154
155
156 a1 = atan2(A1->
y - C.
y, A1->
x - C.
x);
157 a3 = atan2(A3->
y - C.
y, A3->
x - C.
x);
158
159
160 if ( clockwise )
161 {
162 if ( a1 > a3 )
163 angle = a1 - a3;
164 else
165 angle = 2*M_PI + a1 - a3;
166 }
167 else
168 {
169 if ( a3 > a1 )
170 angle = a3 - a1;
171 else
172 angle = 2*M_PI + a3 - a1;
173 }
174
175
176 return circumference_A * (angle / (2*M_PI));
177}
#define LW_TRUE
Return types for functions with status returns.
double lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D *result)
Determines the center of the circle defined by the three given points.
int lw_segment_side(const POINT2D *p1, const POINT2D *p2, const POINT2D *q)
lw_segment_side()
int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3)
Returns true if arc A is actually a point (all vertices are the same) .
int p2d_same(const POINT2D *p1, const POINT2D *p2)