Resulting vector and angle from two vectors

2 ビュー (過去 30 日間)
Anna
Anna 2017 年 5 月 7 日
回答済み: Star Strider 2017 年 5 月 7 日
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