xya
Updated: Sep20,2018

Give a single set of (X,Y) values, compute the corresponding radius and position angle in degrees. See the online "--help" page for details. Briefly, the angles increase in a counterclockwise (CCW) direction, where a PA=0 value is in the direction of the +Y axis. The PA angles can only take values in the range 0.0 < PA < 360.0 (and actually 360 will always be expressed as 0).


% xya.sh --help  

I also wrote another routine that will process a list of X,Y values assuming a fixed center at Xo,Yo. This is xya_list should give the same answers as xya.sh.


% cat list.1
    0   +1   
   -1    0   
    0   -1  
   +1    0
    0  +100 
 -200     0   
    0   -150 
 +300      0  

% xya_list list.1 0.0 0.0
     0.00      1.00      0.00      1.00      1.00     0.00
    -1.00      0.00     -1.00      0.00      1.00    90.00
     0.00     -1.00      0.00     -1.00      1.00   180.00
     1.00      0.00      1.00      0.00      1.00   270.00
     0.00    100.00      0.00    100.00    100.00     0.00
  -200.00      0.00   -200.00      0.00    200.00    90.00
     0.00   -150.00      0.00   -150.00    150.00   180.00
   300.00      0.00    300.00      0.00    300.00   270.00

For comparison:
% xya.sh 0 1
     0.00      1.00      1.00     0.00
% xya.sh -200 0
  -200.00      0.00    200.00    90.00
% xya.sh 300 0
   300.00      0.00    300.00   270.00





Back