168 LWDEBUG(2,
"pointArray_svg_arc called.");
170 for (i = 2; i < pa->
npoints; i+=2)
172 LWDEBUGF(3,
"assvg_circstring: arc ending at point %d", i);
173 int largeArcFlag, sweepFlag, clockwise;
187 if ( t1->
x == t3->
x && t1->
y == t3->
y ){
196 a1 = atan2(t1->
y - center.
y, t1->
x - center.
x)*180/M_PI;
198 a3 = atan2(t3->
y - center.
y, t3->
x - center.
x)*180/M_PI;
200 LWDEBUGF(2,
" center is POINT(%.15g %.15g) - radius:%g", center.
x, center.
y, radius);
202 total_angle = clockwise ? a1 - a3 : a3 - a1;
203 if (total_angle < 0 ){
210 largeArcFlag = (total_angle <= 180)? 0 : 1;
213 sweepFlag = (p2_side == -1) ? 1 : 0;
214 if ( (i == 2) && !is_circle ){
221 if ( (i == 2) && is_circle){
#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.
#define OUT_DOUBLE_BUFFER_SIZE
int lw_segment_side(const POINT2D *p1, const POINT2D *p2, const POINT2D *q)
lw_segment_side()
int lwprint_double(double d, int maxdd, char *buf)
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.