I have 2 points, P and Q, on a directed line AB in 3D space. They can be anywhere on the line, i.e. not necessarily between A and B.
Pythagoras gives you the distance, obviously, but how do I calculate the sign of the directed distance from P to Q?
Accepted answer: I was aware of Nick's solution, but I find it ugly because of the test you have to do (check if AB is parallel to any of the axis). So instead I chose Zach's solution; it's short and straightforward. I guess I'm didn't think of it because I'm not familiar enough with vector algebra. Thanks for the replies everybody.