Resulting vector and angle from two vectors

2 次查看(过去 30 天)
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?

回答(1 个)

Star Strider
Star Strider 2017-5-7
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.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by