Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find sign of directed distance?

Tags:

math

geometry

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?

like image 878
stevenvh Avatar asked Oct 24 '25 20:10

stevenvh


1 Answers

Take the dot product of AB and PQ. Positive => same direction, negative => opposite direction.

like image 63
Zach Scrivena Avatar answered Oct 28 '25 04:10

Zach Scrivena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!