diff options
author | lecoanet | 2002-05-16 08:25:24 +0000 |
---|---|---|
committer | lecoanet | 2002-05-16 08:25:24 +0000 |
commit | 12a44dc133cf2c0426664f1ffaef7ded92f6c2f3 (patch) | |
tree | 4ec76d47b52fa42563dcfc4332bd4918f304e008 /generic | |
parent | bedc3272a1dba4e19a1a7b3656e8968b6a23b0d0 (diff) | |
download | tkzinc-12a44dc133cf2c0426664f1ffaef7ded92f6c2f3.zip tkzinc-12a44dc133cf2c0426664f1ffaef7ded92f6c2f3.tar.gz tkzinc-12a44dc133cf2c0426664f1ffaef7ded92f6c2f3.tar.bz2 tkzinc-12a44dc133cf2c0426664f1ffaef7ded92f6c2f3.tar.xz |
Correction de la fonction GetCirclePoints qu prend d�sormais un
angle_extent � la place du end_angle. Le start_angle et le angle_extent
peuvent �tre n�gatifs. Ils sont exprim�s en radians.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/Geo.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/generic/Geo.c b/generic/Geo.c index b1ec972..48471d3 100644 --- a/generic/Geo.c +++ b/generic/Geo.c @@ -2065,7 +2065,7 @@ ZnPoint * GetCirclePoints(int type, int quality, ZnReal start_angle, - ZnReal end_angle, + ZnReal angle_extent, int *num_points, ZnList point_list) { @@ -2219,7 +2219,7 @@ GetCirclePoints(int type, ZnPoint *p, *p_from; ZnPoint center_p = { 0.0, 0.0 }; ZnPoint start_p, wp; - ZnReal iangle; + ZnReal iangle, end_angle; switch (quality) { case ZN_CIRCLE_COARSE: @@ -2239,8 +2239,18 @@ GetCirclePoints(int type, num_p = sizeof(genarc_fine)/sizeof(ZnPoint); p = p_from = genarc_fine; } - + + /*printf("start: %g, extent: %g\n", start_angle, angle_extent);*/ + if (angle_extent == 2*M_PI) { + type = 3; + } if (type != 3) { + end_angle = start_angle+angle_extent; + if (angle_extent < 0) { + iangle = start_angle; + start_angle = end_angle; + end_angle = iangle; + } /* * normalize start_angle and end_angle. */ @@ -2250,15 +2260,10 @@ GetCirclePoints(int type, if (end_angle < 0.0) { end_angle += 2.0*M_PI; } - if (start_angle == end_angle) { - type = 3; - } - if (start_angle > end_angle) { - iangle = start_angle; - start_angle = end_angle; - end_angle = iangle; + if (end_angle < start_angle) { + end_angle += 2.0*M_PI; } - start_angle = fmod(start_angle, 2.0*M_PI); + /*printf("---start: %g, end: %g\n", start_angle, end_angle);*/ } /* |