19 |
|
A2,A3,A4 - X,Y,Z dimensions of axis-aligned box |
20 |
|
} |
21 |
|
{ local definitions } |
22 |
– |
norm_deg(d) : if( d, d, d+360 ); |
22 |
|
boxprojection = abs(Dx)*A3*A4 + abs(Dy)*A2*A4 + abs(Dz)*A2*A3; |
23 |
|
lboxprojection = ( noneg(abs(Px-Dx*Ts)-A2/2)*A3*A4 + |
24 |
|
noneg(abs(Py-Dy*Ts)-A3/2)*A2*A4 + |
30 |
|
lboxcorr(v) = A1 * v / lboxprojection; { local box correction } |
31 |
|
|
32 |
|
src_theta = Acos(Dz) / DEGREE; { 0-180 } |
33 |
< |
src_phi = norm_deg( atan2(Dy, Dx) / DEGREE ); { 0-360 } |
33 |
> |
src_phi = mod( atan2(Dy, Dx) / DEGREE, 360 ); { 0-360 } |
34 |
|
{ bilateral symmetry } |
35 |
|
src_phi2 = tri( src_phi, 180 ); { 0-180 } |
36 |
|
{ quadrilateral symmetry } |