home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
RADIANCE
/
LIB
/
PEREZSKY.CAL
< prev
next >
Wrap
Text File
|
1993-10-07
|
617b
|
24 lines
{
Sky luminance model developed by Richard Perez, Robert Seals,
Joseph Michalsky and Pierre Ineichen
7/1/92
}
fact(n) : if(n, n*fact(n-1), 1); { factorial -- n must be integer }
A=.3; B=6; C=.1310; D=3; E=.3200; { Test coefficients }
Coef1 : (1-A)/fact(B)/C^(B+1);
Coef2 : A/fact(D)/E^(D+1);
{ Probability density function for intensity q }
P(q) = Coef1*q^B*exp(-q/C) + Coef2*q^D*exp(-q/E);
{ Integral used to generate random intensity }
QsumStep : .02;
Qfind(X,q,s) = if( s-X, -QsumStep/2+q,
Qfind(X, q+QsumStep, s+QsumStep*P(QsumStep/2+q)) );
Qrand(x) = Qfind(rand(x),0,0);