ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/klems_half.cal
(Generate patch)

Comparing ray/src/util/klems_half.cal (file contents):
Revision 1.2 by greg, Mon Jul 21 15:59:47 2014 UTC vs.
Revision 1.5 by greg, Thu Jul 14 02:52:02 2022 UTC

# Line 12 | Line 12 | Acos(x) : if(x-1, 0, if(-1-x, PI, acos(x))) / DEGREE;
12   posangle(a) : if(-a, a + 2*PI, a) / DEGREE;
13   Atan2(y,x) : posangle(atan2(y,x));
14  
15 < khpola(r) : select(r, 6.5, 19.5, 32.5, 46.5, 61.5, 76.5, 90);
16 < khnaz(r) : select(r, 1, 8, 12, 16, 20, 12, 4);
15 > khpola(r) : select(r, 6.5, 19.5, 32.5, 45.5, 58.5, 71.5, 90);
16 > khnaz(r) : select(r, 1, 8, 12, 16, 20, 12, 8);
17   khaccum(r) : if(r-.5, khnaz(r) + khaccum(r-1), 0);
18   khfindrow(r, pol) : if(r-khpola(0)+.5, r,
19                  if(pol-khpola(r), khfindrow(r+1, pol), r) );
# Line 28 | Line 28 | khbin2(pol,azi) = if(pol-90, -1,
28                  khaccum(3) + khazn(azi,360/khnaz(4)),
29                  khaccum(4) + khazn(azi,360/khnaz(5)),
30                  khaccum(5) + khazn(azi,360/khnaz(6)),
31 <                khaccum(6) + khazn(azi,360/khnaz(7)),
32 <                khaccum(7) + khazn(azi,360/khnaz(8))
31 >                khaccum(6) + khazn(azi,360/khnaz(7))
32          ) );
33  
34 + RHS = 1;        { set to -1 for left-handed system }
35 +
36   khbin(Nx,Ny,Nz,Ux,Uy,Uz) = khbin2(Acos(-Dx*Nx-Dy*Ny-Dz*Nz),
37          Atan2(-Dx*Ux-Dy*Uy-Dz*Uz + (Nx*Dx+Ny*Dy+Nz*Dz)*(Nx*Ux+Ny*Uy+Nz*Uz),
38 <                -Dx*(Uy*Nz-Uz*Ny) - Dy*(Uz*Nx-Ux*Nz) - Dz*(Ux*Ny-Uy*Nx)));
38 >                -RHS*(Dx*(Uy*Nz-Uz*Ny) + Dy*(Uz*Nx-Ux*Nz) + Dz*(Ux*Ny-Uy*Nx))));
39                                  
40   Nkhbins : khaccum(khnaz(0));    { Number of bins for one elevation }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines