how do you find if any given 3 points (in 3D) lie on a straight line
...? np just doing some calc problems, I'm given 3 points and need to find if all three lie on a straight line
is it by finding midpoints?
Okay, so if you find the difference between two points... that will give you a vector.
So get two vectors from the three points.
If you do the cross product and get 0 then they're parallel
Parallel vectors which go through the same point are on the same line.
so out of the 3 points, use 2 to find a vector, then us another set of 2 from the 3 not used in the first one to find another vector and if the quell then all 3 points are in a line?
No, from the two points get two vectors. Use the cross product of the two vectors to find out if they're parallel
but i got 3 points, so pick any 2?
Pick any two for the first vector, and then change one of the points for the second vector.
Okay suppose your points are \(P_1,P_2, P_3\). Let:\[ \mathbf v_1=P_2-P_1\\ \mathbf v_2=P_3-P_1 \]If: \[ \mathbf v_1\times \mathbf v_2=\mathbf 0 \]Then \(P_1,P_2, P_3\) are on the same line.
i got the cross product, and now i square all 3 and square root that to see if it = 0 right?
Join our real-time social learning platform and learn together with your friends!