plot x, y and direction
이전 댓글 표시
Hi all,
I have values for x, y, and Azimuth, where Azimuth is in range of 0 to 360 degree measured from the North in clockwise.
how can I plot them in a 2D graph which shows the point with direction arrow?
x
607261.185639785
607280.329476425
607367.827131141
y
4821687.60219055
4821678.02095485
4821646.17145724
direction
108
108
115.142857142857
답변 (7개)
Walter Roberson
2011년 1월 21일
2 개 추천
You probably want to use quiver() to plot your vector fields.
Walter Roberson
2011년 1월 21일
To change from compass direction (in degrees) with north being 0, to standard cartesian angles measured counter-clockwise from y=0, use
planar_angle = mod(90 - compass_angle, 360);
zheng
2011년 1월 21일
편집: Walter Roberson
2018년 11월 7일
Walter Roberson
2011년 1월 21일
The q variables are logical vectors indicating whether each angle is in a particular quadrant. data(q3==1,1) selects only the rows of data that are in quadrant 3, and selects column 1 from the resulting array.
Instead of modifying the existing code to change the logic, go back to the original logic, but copy the assignment of those constants to data into a new variable planar_data, then comment out the assignment to data; then in the planar_data array, set the third column to your sample compass degrees that you want for testing purposes. After that step, assign
data = [planar_data(:,1,2) mod(90 -planar_data(:,3),360)];
Once you have the demonstration going, make it in to a function that takes planar_data as a parameter instead of assigning hard-coded values to it.
Ankita Misra
2017년 11월 8일
0 개 추천
I have Landsat solar angles which i would like to plot as arrows . I have three variables x,y and the angle . How do I plot them to show meaningful directions ?
댓글 수: 1
Walter Roberson
2017년 11월 9일
I would suggest using quiver(). You could use sin(angle) and cos(angle) as the u and v (or is it the other way around?)
theodore panagos
2018년 11월 7일
편집: Walter Roberson
2018년 11월 7일
The formula f(E,N) give an angle that starts from the north,is clockwise,runs from 0 to 360 degrees
and is used in surveying.
f(E,N)=180/pi()*(pi()-pi()/2*(1+sign(N))*(1-sign(E^2))-pi()/4*(2+sign(N))*sign(E) -sign(N*E)*atan((abs(N)-abs(E))/(abs(N)+abs(E))))
There is N(northing)=N2-N1 and E(easting)=E2-E1 ,the formula works for any value of N and E and the result for N=E=0 is undefined.
카테고리
도움말 센터 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!