Resulting vector and angle from two vectors
7 views (last 30 days)
Show older comments
Hi,
I have two vectors U and V with wind velocities. V is positive from south to north, and U is positive from west to east. I am wondering if there is a good way in matlab to combine these two vectors in order to get the resulting vector and angle in a 360 degree order where 0 is due north?
0 Comments
Answers (1)
Star Strider
on 7 May 2017
You’ve not provided enough information to write a specific Answer.
I have no idea what your data are, so this is purely a guess:
u = sind(135+90);
v = cosd(135-90);
anglq = atan2d(u,v); % Angle Corrected For Quadrant
Angles360 = @(a) rem(360+a, 360); % For ‘atan2d’
angl360 = Angles360(anglq);
I’ll delete my Answer if I guessed wrong and this is wildly off-the-mark.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!