Jump to content

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...

Thanks in advance


Share this post

Link to post
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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now