Open adamfranco opened 8 years ago
I think the issue is that the three data points simply are in a straight line. If you imagine a triangle in which the base is equal to the two remaining sides the height will be very close to zero.
I think we can handle this by checking if the sum of a
and b
is less than c
we simply return the max radius
Oh, thanks for this explanation -- makes total sense. :-)
For pairs of segments that have the same length and a base that is twice their length, the circumcircle-radius algorithm results in a division-by-zero error. The test script below will demonstrate this.
I've not yet found another algorithm for finding the circumcircle radius that doesn't have this issue, but there may be one out there.