Orthogonal projection - embarrassed

Click For Summary
SUMMARY

The discussion revolves around projecting 3D points onto the span of two orthogonal vectors using MATLAB. The user, Duane, initially applied the orthogonal projection formula correctly but encountered issues with the MATLAB function quiver3, which failed to plot the vectors accurately. After troubleshooting, Duane created a custom plotting method to visualize the results, confirming the mathematical calculations were correct.

PREREQUISITES
  • Understanding of orthogonal projection in linear algebra
  • Familiarity with MATLAB programming environment
  • Knowledge of vector operations, including dot product and normalization
  • Experience with MATLAB's quiver3 function for 3D vector visualization
NEXT STEPS
  • Research MATLAB's quiver3 function and its parameters for accurate vector plotting
  • Explore alternative visualization techniques in MATLAB for 3D data
  • Study orthogonal projection methods in linear algebra for deeper understanding
  • Learn about debugging techniques in MATLAB to inspect intermediate results
USEFUL FOR

This discussion is beneficial for mathematicians, engineers, and programmers working with 3D graphics and vector mathematics, particularly those using MATLAB for data visualization and analysis.

physical101
Messages
41
Reaction score
0
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 don't get the points projected onto the plane.

Any ideas were I am going wrong?

Cheers

Duane
 
Physics news on Phys.org
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
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 4 ·
Replies
4
Views
6K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K