Magnitude and direction from north and east components
29 ビュー (過去 30 日間)
表示 古いコメント
I have displacement data components along north and east how to find its magnitude and direction with reference to north(0-360) in matlab. The components may have same sign or opposite both possible.
採用された回答
Deepak Gupta
2020 年 4 月 22 日
編集済み: Deepak Gupta
2020 年 4 月 22 日
Hi Mithun,
You can think of North and East as your X and Y. As you have taken north as reference so use below formulas to calculate magnitude and angle.
Magnitude = sqrt(North^2+East^2);
Theta = atan((-East)/North);
I am using -East because East is 90 degree closewise to North and atan calculates angles in counter clockwise directions from reference.
Thanks,
Deepak
その他の回答 (1 件)
KSSV
2020 年 4 月 22 日
If (x,y) is a componenet
m = sqrt(x^2+y^2) ; % magnitude
theta = atan(y/x) ; % direction
参考
カテゴリ
Find more on Weather and Atmospheric Science in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!