SwiftSimplify icon indicating copy to clipboard operation
SwiftSimplify copied to clipboard

Error or less-than-ideal-naming on distance functions

Open AndrewLipscomb opened this issue 6 years ago • 0 comments

https://github.com/malcommac/SwiftSimplify/blob/95856a3fce40e4a77f51050d5b6c1f59da072355/Sources/SwiftSimplify/Point2DRepresentable.swift#L54

These appear to be returning a standard Pythagoras result, but the result is not square rooted. AFAIK this is not meant to be the case but I haven't had time to dig (I only know the DP algorithm at a distance).

If this is meant to be a linear distance, it looks like it needs to be square rooted. Else it might help to modify the function names to indicate that this is a squared result - otherwise it looks like a straightforward distance calculation function.

AndrewLipscomb avatar Nov 06 '19 00:11 AndrewLipscomb