Changed how ec and r are calculated. Both are absolute distances.
Changed how ec and r are calculated. Both are absolute distances.

Through testing it was discovered the ec and r can become negative which
makes no sense because they are distances from one point to another. The
coordinates themselves can be positive or negative but distances can only
be positive.

The equations had to be modified to reflect this change.

mwhit74/sbc