PDA

View Full Version : Vector between a point and a line segment?

 daiArna03-30-2012, 05:32 PMHow can I compute the vector value between a point (P) and a line segment (AB) in 3D space? http://www.whaleanddeer.com/forum/vector2.jpg or the coordinate of the point C?
uiron
04-03-2012, 06:53 AM
vector AC is a projection of AP onto AB, so

AC = (AP dot normalized(AB))*normalized(AB)

daiArna
04-03-2012, 10:30 PM
vector AC is a projection of AP onto AB, so

AC = (AP dot normalized(AB))*normalized(AB)

Thanks. What are the functions for norm and dot in Maya expression?

ThE_JacO
04-05-2012, 12:13 AM
Inputting EXACTLY your question into google the very first result is this:
http://forums.cgsociety.org/archive/index.php/t-1043434.html

Which not only answers your question, but the previous one as well, all together.

A useful site with these formulas (which also pops early by just punching your first post into google)
http://local.wasp.uwa.edu.au/~pbourke/geometry/

CGTalk Moderation
04-05-2012, 12:13 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.