\n","author":{"@type":"Person","name":"Abdul Kahar"},"upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"
You're just finding the height of a triangle. Fortunately you can instantly google the formula:
\nhttps://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
\n\n\n\n
Again, the formula is widely available
\nhttps://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
\n\nHere's the bible that all game programmers have to memorize by heart!
\nhttp://amazon.com/Mathematics-Programming-Computer-Graphics-Third/dp/1435458869
\n\n","author":{"@type":"Person","name":"Fattie"},"upvoteCount":0}}}Reputation: 37
I have three 3D points, just say p1, p2, and p3. I am able to make a line that connects p1 and p2. Then, the p3 will be in between the p1 and p2 but not collinear. I want to know if the p3 is close to the line. How to check it?
Upvotes: 1
Views: 172
Reputation: 12296
You're just finding the height of a triangle. Fortunately you can instantly google the formula:
https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
Again, the formula is widely available
https://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
Here's the bible that all game programmers have to memorize by heart!
http://amazon.com/Mathematics-Programming-Computer-Graphics-Third/dp/1435458869
Upvotes: 0