| 1065 | } |
| 1066 | |
| 1067 | static double osCalculateArcRadius(pointObj *pnt) |
| 1068 | { |
| 1069 | double rc; |
| 1070 | double r1, r2, r3; |
| 1071 | |
| 1072 | r1 = sqrt( pow(pnt[0].x-pnt[1].x,2) + pow(pnt[0].y-pnt[1].y,2) ); |
| 1073 | r2 = sqrt( pow(pnt[1].x-pnt[2].x,2) + pow(pnt[1].y-pnt[2].y,2) ); |
| 1074 | r3 = sqrt( pow(pnt[2].x-pnt[0].x,2) + pow(pnt[2].y-pnt[0].y,2) ); |
| 1075 | rc = ( r1+r2+r3 )/2; |
| 1076 | |
| 1077 | return ( ( r1*r2*r3 )/( 4*sqrt( rc * (rc-r1) * (rc-r2) * (rc-r3) ) ) ); |
| 1078 | } |
| 1079 | |
| 1080 | static void osCalculateArc(pointObj *pnt, int data3d, int data4d, double area, double radius, double npoints, int side, lineObj arcline, shapeObj *shape) |
| 1081 | { |