How to find the projection of vectors from corrdinates?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Karl Bridggie
il 14 Set 2022
Commentato: Karl Bridggie
il 15 Set 2022
Hi,
If I have the corrdinates of two vectors (not the elements of the vectors) in 2D plane
v1: from (1, 2) to (9, 10)
v2: from (9, 10) to (6, 14)
is there a way to get the projection of v1 on v2?
Thanks a lot for your help!
2 Commenti
Dyuman Joshi
il 14 Set 2022
This is a simple mathematics question. Yes, there is a way to get what you want.
But how does this relate to MATLAB?
Is this a homework/assignment problem? If so, what have you tried yet?
Risposta accettata
Dyuman Joshi
il 14 Set 2022
Proceed the same way as you would on pen and paper. You can use points to define the vector -
%[x-coordinate y-coordinate]
p1=[1 2];
p2=[9 10];
p3=[9 10];
p4=[6 14];
%defining vectors
v1=p2-p1;
v2=p4-p3;
%Therefore, projection of v1 on v2 is
projv1_v2=dot(v1,v2)/dot(v2,v2)*v2
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!