Calculate perpendicular vector

Recommended Posts

I'm having a little difficulty with some matrix maths. I have 3 points P0, P1 and P2 [as in the attached drawing] and I need to find the point on the line between p0 and p1, such that the line from it to P2 is perpendicular to it.

The way I tried is to first find the angle between P0-->P1 and P0-->P2 [acos of the dot product], then from there find the lengths a, o and a using trig, from there it's simple to find the correct position but somewhere or other I'm going wrong.

I'll persevere but I wondered if there is some standard function to find that position, I imagine it must be a common thing to want to do...

Share on other sites

I figured it out, I had a plus instead of a minus...

Share on other sites

• 2 months later...

Hey is it possible for you to attach your hip file for me too see how you did it?

Thank you.

Regards

Varisht

Share on other sites

I don't have that particular file to hand any more but I made you a file to demonstrate an easier method.

If you take the dot product of the normalized vector P0->P1 in the drawing above, and the UNnormalized vector P0->P2 that will give you the magnitude of the vector in the (normalized) direction P0->P1 that the perpendicular projection point is. That's probably a bit garbled but if you look at the file I hope it will make sense...

Edited by j00ey

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×