I need a basic function to find the shortest distance between a point and a line segment.Feel free to write the solution in any language you want; I can translate it into what I\'m using (Javascript).
When using the usual formulas to calculate intersection between two 2D segments, ie here, if you round the result to an integer, you get non-symm开发者_StackOverflow社区etric results.
Finding the point of intersection for two 2D line segments is easy; the formula is st开发者_如何学编程raight forward. But finding the point of intersection for two 3D line segments is not, I afraid.
This is just a LARGE generalized question regarding rays (and/or line segments or edges etc) and their place in a software rendered 3d engine that is/not performing raytracing operations. I\'m learnin