19 |
|
|
20 |
|
{ Default to Tregenza sky } |
21 |
|
MF = 1; |
22 |
+ |
{ Set to -1 for left-handed coordinate system } |
23 |
+ |
RHS = 1; |
24 |
|
{ Default axis orientation (+Y == north) } |
25 |
|
rNx = 0; rNy = 0; rNz = -1; |
26 |
|
Ux = 0; Uy = 1; Uz = 0; |
27 |
|
{ Compute oriented axis angles } |
28 |
|
inc_dz = -Dx*rNx-Dy*rNy-Dz*rNz; |
29 |
< |
inc_rx = -Dx*(Uy*rNz-Uz*rNy) - Dy*(Uz*rNx-Ux*rNz) - Dz*(Ux*rNy-Uy*rNx); |
29 |
> |
inc_rx = -RHS*(Dx*(Uy*rNz-Uz*rNy) + Dy*(Uz*rNx-Ux*rNz) + Dz*(Ux*rNy-Uy*rNx)); |
30 |
|
inc_ry = Dx*Ux+Dy*Uy+Dz*Uz + inc_dz*(rNx*Ux+rNy*Uy+rNz*Uz); |
31 |
|
|
32 |
|
r_alt = Asin(inc_dz); |