Changeset 13802
- Timestamp:
- Jun 13, 2007, 1:39:58 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psEllipse.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psEllipse.c
r13425 r13802 46 46 47 47 // ellipse rotation (major, minor, theta) -> (x2, y2, xy) 48 // XXXX handle case where e0 < LIMIT 48 49 psErrorCode psEllipsePolToAxes(const psEllipsePol pol, 49 50 const float minMinorAxis, … … 63 64 64 65 float LIMIT = PS_SQR(minMinorAxis); 65 if (2.0*(pol.e0 - ds) < LIMIT) { 66 axes->major = sqrt(pol.e0 - LIMIT); 67 axes->minor = sqrt(LIMIT); 66 if (pol.e0 < LIMIT) { 67 // if e0 is too small, we are really out of luck 68 axes->major = minMinorAxis; 69 axes->minor = minMinorAxis; 68 70 } else { 69 axes->major = sqrt(0.5*(pol.e0 + ds)); 70 axes->minor = sqrt(0.5*(pol.e0 - ds)); 71 if (2.0*(pol.e0 - ds) < LIMIT) { 72 // if e0 - ds is too small, saturate the minor axis at minMinorAxis 73 axes->major = sqrt(pol.e0 - LIMIT); 74 axes->minor = sqrt(LIMIT); 75 } else { 76 // normal values for e0 & ds 77 axes->major = sqrt(0.5*(pol.e0 + ds)); 78 axes->minor = sqrt(0.5*(pol.e0 - ds)); 79 } 71 80 } 72 81
Note:
See TracChangeset
for help on using the changeset viewer.
