79caeb643a3b4cd907a69dc447e5eea3b5d7fd10
static char sccsid
[] = "@(#)arc.c 4.1 (Berkeley) %G%";
arc(xcent
,ycent
,xbeg
,ybeg
,xend
,yend
)
int xcent
,ycent
,xbeg
,ybeg
,xend
,yend
;
double costheta
,sintheta
,x
,y
,xn
,r
;
int xi
,yi
,crosspflag
,crossp
;
r
= (xcent
-xbeg
)*(xcent
-xbeg
)+(ycent
-ybeg
)*(ycent
-ybeg
);
costheta
= pow(1-sintheta
*sintheta
,0.5);
crossp
= cross_product(x1
,y1
,x2
,y2
,x
,y
);
if(crossp
>0 && crosspflag
== 0) crosspflag
= 1;
point(xcent
+xi
,ycent
+yi
);
xi
= x
= x
*costheta
+ y
*sintheta
;
yi
= y
= y
*costheta
- xn
*sintheta
;
} while( crosspflag
== 0 || crossp
>0);
cross_product(x1
,y1
,x2
,y2
,x3
,y3
)
double x1
,x2
,x3
,y1
,y2
,y3
;