plot x, y and direction
18 views (last 30 days)
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?
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);
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 on 8 Nov 2017
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 ?
theodore panagos on 7 Nov 2018
Edited: Walter Roberson on 7 Nov 2018
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.
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.