Jump to content
  • Advertisement
Sign in to follow this  
gbalajimecse

how to find point on the line with given distance and from given point

This topic is 3263 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi how to find point on the 3D line with given distance and from given point how to calculate the point on the 3D line from the given point,distance to looking point on line and the line equation please explain me the derivation

Share this post


Link to post
Share on other sites
Advertisement
Well to start you off, a specific distance from a given point will yield you a sphere with that distance as the radius. So the answer will be where the line intersects the sphere. I'm sure that there are plenty of resources online about intersecting a line and a sphere.

Share this post


Link to post
Share on other sites
First, find the distance between the point and the line. Paul Bourke has the derivation available here.

The point "C" on the line closest to the point "A" not on the line is the perpendicular corner of a right triangle. The distance you want is the hypotenuse of the right triangle. Use the pythagorean theorem to solve for the length of the other side. This length we call scalar "a" (not point "A"). The point "B" we are looking for is on the line, and completes the right triangle. There are actually two point "Bs", corresponding to "up" and "down" the line from C, in the direction of the line which we label with the normal vector "D". The values of "B" are therefore C+(a*D) and C-(a*D).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!