Magnitude and direction from north and east components
    조회 수: 8 (최근 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.
댓글 수: 2
채택된 답변
  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
댓글 수: 5
  Deepak Gupta
      
 2020년 4월 22일
				Read comments added already and think before asking further questions. Test the code with a known values.
추가 답변 (1개)
  KSSV
      
      
 2020년 4월 22일
        If (x,y) is a componenet 
m = sqrt(x^2+y^2)  ;   % magnitude 
theta = atan(y/x) ;   % direction 
참고 항목
카테고리
				Help Center 및 File Exchange에서 Weather and Atmospheric Science에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


