Magnitude and direction from north and east components
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
2 commentaires
Réponse acceptée
Deepak Gupta
le 22 Avr 2020
Modifié(e) : Deepak Gupta
le 22 Avr 2020
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
5 commentaires
Deepak Gupta
le 22 Avr 2020
Read comments added already and think before asking further questions. Test the code with a known values.
Plus de réponses (1)
KSSV
le 22 Avr 2020
If (x,y) is a componenet
m = sqrt(x^2+y^2) ; % magnitude
theta = atan(y/x) ; % direction
Voir également
Catégories
En savoir plus sur Seismology dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!