Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

Closest Point on a line segment for different distance metrics (i.e L1 norm, max norm)

$
0
0

Does anyone have a good reference/suggestions for how to find the point on lineseg ab closest to some query point p, for non-euclidian distance metrics? (Specifically I'd like to know L1 norm and max norm).

(Let me know if this is trivial, I just can't find anything about distance-to-segment queries that isn't L2-norm. tbh I don't super-understand the concept of distance metrics well enough to intuit anything.)


For reference, here's the normal Euclidian-distance aka L2-norm version of what I'm after (a closest-point-on-lineseg query), from: https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm )

vec2 …

Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>