Compute X,Y offsets and an associated rotation angle.
% xyoff.sh 0 0 -0.866 +0.500 -0.8660 0.5000 1.0000 150.00The first two output values are dX,dY and the next two are the radius (separation) and the position angle in degrees. The angle is defined in the sense where X1,Y1 are the origin, and theta=0 is in the positive X axis direction. To easily demonstrate the angle conventions, I set up a test script (RUN_1) that gives the user a nice table. Also, the conventions are printed to a file called "xyoff.angle_explain" everytime xyoff.sh is run.
% cat RUN_1 #!/bin/bash printf " dX dY Rad Theta \n" # xyoff.sh 0 0 -1.000 +0.000 xyoff.sh 0 0 -0.866 +0.500 xyoff.sh 0 0 -0.707 +0.707 xyoff.sh 0 0 -0.500 +0.866 xyoff.sh 0 0 +0.000 +1.000 xyoff.sh 0 0 +0.500 +0.866 xyoff.sh 0 0 +0.707 +0.707 xyoff.sh 0 0 +0.866 +0.500 xyoff.sh 0 0 +1.000 +0.000 xyoff.sh 0 0 +0.866 -0.500 xyoff.sh 0 0 +0.707 -0.707 xyoff.sh 0 0 +0.500 -0.866 xyoff.sh 0 0 +0.000 -1.000 xyoff.sh 0 0 -0.500 -0.866 xyoff.sh 0 0 -0.707 -0.707 xyoff.sh 0 0 -0.866 -0.500 % RUN_1 dX dY Rad Theta -1.0000 0.0000 1.0000 180.00 -0.8660 0.5000 1.0000 150.00 -0.7070 0.7070 0.9998 135.00 -0.5000 0.8660 1.0000 120.00 0.0000 1.0000 1.0000 90.00 0.5000 0.8660 1.0000 60.00 0.7070 0.7070 0.9998 45.00 0.8660 0.5000 1.0000 30.00 1.0000 0.0000 1.0000 0.00 0.8660 -0.5000 1.0000 -30.00 0.7070 -0.7070 0.9998 -45.00 0.5000 -0.8660 1.0000 -60.00 0.0000 -1.0000 1.0000 -90.00 -0.5000 -0.8660 1.0000 -120.00 -0.7070 -0.7070 0.9998 -135.00 -0.8660 -0.5000 1.0000 -150.00 % cat xyoff.angle_explain # Angle conventions in xyoff. 1) Theta=0 is in +X axis direction. 2) Angles increase in POSITIVE sense CCW 3) Angles increase in NEGATIVE sense CW 4) Upper hemisphere ---> Theta runs 0 to +180 Degrees 5) Lower hemisphere ---> Theta runs 0 to -180 Degrees