/usr/share/radiance/klems_int.cal is in radiance-materials 4R1+20120125-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | { RCSid $Id: klems_int.cal,v 1.6 2011/04/11 03:47:46 greg Exp $ }
{
Compute interior bin for (full) Klems BSDF basis (0-144)
Modified from Tregenza.cal, which is similar but different
6/14/2009 G. Ward
}
DEGREE : PI/180;
Acos(x) : if(x-1, 0, if(-1-x, 0, acos(x))) / DEGREE;
posangle(a) : if(-a, a + 2*PI, a) / DEGREE;
Atan2(y,x) : posangle(atan2(y,x));
kpola(r) : select(r, 5, 15, 25, 35, 45, 55, 65, 75, 90);
knaz(r) : select(r, 1, 8, 16, 20, 24, 24, 24, 16, 12);
kaccum(r) : if(r-.5, knaz(r) + kaccum(r-1), 0);
kfindrow(r, pol) : if(r-kpola(0)+.5, r,
if(pol-kpola(r), kfindrow(r+1, pol), r) );
kazn(azi,inc) : if((360-.5*inc)-azi, floor((azi+.5*inc)/inc), 0);
kbin2(pol,azi) = select(kfindrow(1, pol),
kazn(azi,360/knaz(1)),
kaccum(1) + kazn(azi,360/knaz(2)),
kaccum(2) + kazn(azi,360/knaz(3)),
kaccum(3) + kazn(azi,360/knaz(4)),
kaccum(4) + kazn(azi,360/knaz(5)),
kaccum(5) + kazn(azi,360/knaz(6)),
kaccum(6) + kazn(azi,360/knaz(7)),
kaccum(7) + kazn(azi,360/knaz(8)),
kaccum(8) + kazn(azi,360/knaz(9))
);
kbin(Nx,Ny,Nz,Ux,Uy,Uz) = kbin2(Acos(-Dx*Nx-Dy*Ny-Dz*Nz),
Atan2(-Dx*Ux-Dy*Uy-Dz*Uz,
-Dx*(Uy*Nz-Uz*Ny) - Dy*(Uz*Nx-Ux*Nz) - Dz*(Ux*Ny-Uy*Nx)));
kbinN = kbin(0,-1,0, 0,0,1); { North bins }
kbinE = kbin(-1,0,0, 0,0,1); { East bins }
kbinS = kbin(0,1,0, 0,0,1); { South bins }
kbinW = kbin(1,0,0, 0,0,1); { West bins }
kbinD = kbin(0,0,-1, 0,1,0); { Skylight bins }
Nkbins : kaccum(knaz(0)); { Number of bins for one elevation }
|