Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid division by 0 in perimeter_of_ellipse calculation
While the initial cause of the division by 0 error mentioned in #44 should be fixed, now that this function will never be passed negative numbers, it's still possible when both rx and ry are 0. Add a special case to handle either rx or ry being 0, which returns the "perimeter" of the ellipse as being the twice the length of the line segment between the extremeties. (If both rx or ry are 0, the resulting perimeter will be 0.)
- Loading branch information