Determining direction from three points on a line

91 Views Asked by At

I have a small geometry problem that for some reason I just can't get a grasp on.

  • You're given three points on a line in 3D space, p1, p2, p3. (assume for simplicity that they're named left-to-right)
  • p1 and p2 are static and will not change, but p3 can move freely.
  • How would you determine the direction of the vector p2->p3? (with regards to p2)

At the moment, I'm comparing the length of A, p2->p3 and B, p1->p3.

If the length of A is greater the length of B, then the direction is to the left of p2, if the length of A is less than the length of B, then the direction is to the right of p2.

But I can't get a handle on how to get the direction when p1 < p3 < p2

1

There are 1 best solutions below

0
On BEST ANSWER

Let $A=\overline{p_2p_3},B=\overline{p_1p_3},C=\overline{p_1p_2}$.

Then $p_2$ is in-between $p_1,p_3$ iff $A<B$ and $C<B$.