3 ms·
Given the design constraints: """ A generic library should be able to calculate the distance: for any point class or struct, not on just this mypoint type
by GFK_of_xmaspast 11y ago
Given the design constraints:
"""
A generic library should be able to calculate the distance:
for any point class or struct, not on just this mypoint type
in more than two dimensions
for other coordinate systems, e.g. over the earth or on a sphere
between a point and a line or between other geometry combinations
in higher precision than double
avoiding the square root: often we don't want to do that because it is a relatively expensive function, and for comparing distances it is not necessary
"""
I suspect a little bit of complexity is necessary. (And can you even build something like this in a more fashionable language?)