7 |
|
6/14/2009 G. Ward |
8 |
|
} |
9 |
|
DEGREE : PI/180; |
10 |
< |
Acos(x) : 1/DEGREE * if(x-1, 0, if(-1-x, 0, acos(x))); |
11 |
< |
posangle(a) : if(-a, a + 2*PI, a); |
12 |
< |
Atan2(y,x) : 1/DEGREE * posangle(atan2(y,x)); |
10 |
> |
Acos(x) : if(x-1, 0, if(-1-x, 0, acos(x))) / DEGREE; |
11 |
> |
posangle(a) : if(-a, a + 2*PI, a) / DEGREE; |
12 |
> |
Atan2(y,x) : posangle(atan2(y,x)); |
13 |
|
|
14 |
|
kpola(r) : select(r, 5, 15, 25, 35, 45, 55, 65, 75, 90); |
15 |
|
knaz(r) : select(r, 1, 8, 16, 20, 24, 24, 24, 16, 12); |
33 |
|
|
34 |
|
kbin(Nx,Ny,Nz,Ux,Uy,Uz) = kbin2(Acos(-Dx*Nx-Dy*Ny-Dz*Nz), |
35 |
|
Atan2(-Dx*Ux-Dy*Uy-Dz*Uz, |
36 |
< |
-Dx*(Ny*Uz-Nz*Uy) - Dy*(Nz*Ux-Nx*Uz) - Dz*(Nx*Uy-Ny*Ux))); |
36 |
> |
-Dx*(Uy*Nz-Uz*Ny) - Dy*(Uz*Nx-Ux*Nz) - Dz*(Ux*Ny-Uy*Nx))); |
37 |
|
|
38 |
< |
kbinN = kbin(0,1,0, 0,0,1); { North bins } |
39 |
< |
kbinE = kbin(1,0,0, 0,0,1); { East bins } |
40 |
< |
kbinS = kbin(0,-1,0, 0,0,1); { South bins } |
41 |
< |
kbinW = kbin(-1,0,0, 0,0,1); { West bins } |
38 |
> |
kbinN = kbin(0,-1,0, 0,0,1); { North bins } |
39 |
> |
kbinE = kbin(-1,0,0, 0,0,1); { East bins } |
40 |
> |
kbinS = kbin(0,1,0, 0,0,1); { South bins } |
41 |
> |
kbinW = kbin(1,0,0, 0,0,1); { West bins } |
42 |
|
|
43 |
< |
kbinU = kbin(0,0,1, 0,1,0); { "Up" bins for skylights } |
43 |
> |
kbinD = kbin(0,0,-1, 0,1,0); { Skylight bins } |
44 |
|
|
45 |
< |
Nkbins : kaccum(knaz(0)); { total number of bins } |
45 |
> |
Nkbins : kaccum(knaz(0)); { Number of bins for one elevation } |