Orthogonal projection - embarrassed

Hi there

I am trying to project some 3D points on to the span of two orthogonal vectors.

v1 = [ -0.1235 -0.9831 0.1352]
v2 = [ 0.7332 -0.1822 -0.6552]

I used the orthogonal projection formula

newpoint = oldpoint-dot(oldpoint,normal(v1,v2))*normal(v1,v2);

but when I plot it in matlab I dont get the points projected onto the plane.

Any ideas were I am going wrong?

Cheers

Duane
 

haruspex

Science Advisor
Homework Helper
Insights Author
Gold Member
2018 Award
31,130
4,522
Looks right to me. Have you inspected the intermediate results to see where it diverges from what you expect? (You could start with a simpler pair of vectors.) If still stuck, pls post the intermediate results.
 
Hi there,

Thank you for the reply. I went mental yesterday because I knew the math was right and subsequent calculations, such as the within plane angle, were all correct.

The problem I found was with matlabs quiver3 function. It wasn't plotting the vectors correctly and so in the end I made my own and plotted them using + points. Can't put that in a paper lol but at least it demonstrates what I was trying to do.

Thanks again for thinking about this

Duane
 

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving

Hot Threads

Top