ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/perezlum.cal
Revision: 1.2
Committed: Fri Jan 12 23:48:09 2018 UTC (6 years, 4 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad5R3, HEAD
Changes since 1.1: +3 -3 lines
Log Message:
Optimized cosine calculation

File Contents

# User Rev Content
1 greg 1.2 { RCSid $Id: perezlum.cal,v 1.1 2009/06/06 20:20:04 greg Exp $ }
2 greg 1.1
3     {
4     All-weather Angular Sky Luminance Distribution .
5    
6     Additional arguments required for calculation of skybright:
7    
8     A1 - diffus normalization
9     A2 - ground brightness
10     A3,A4,A5,A6,A7 - coefficients for the Perez model
11     A8,A9,A10 - sun direction
12     }
13    
14    
15    
16    
17     skybright = wmean((Dz+1.01)^10, intersky, (Dz+1.01)^-10, A2 );
18    
19     wmean(a, x, b, y) = (a*x+b*y)/(a+b);
20    
21     intersky = if( (Dz-0.01),
22 greg 1.2 A1 * (1 + A3*Exp(A4/Dz) ) * ( 1 + A5*Exp(A6*gamma) + A7*cosgamma*cosgamma ),
23     A1 * (1 + A3*Exp(A4/0.01) ) * ( 1 + A5*Exp(A6*gamma) + A7*cosgamma*cosgamma ) );
24 greg 1.1
25    
26    
27    
28     cosgamma = Dx*A8 + Dy*A9 + Dz*A10;
29    
30     gamma = Acos(cosgamma); { angle from sun to this point in sky }
31    
32     zt = Acos(A10); { angle from zenith to sun }
33    
34     eta = Acos(Dz); { angle from zenith to this point in sky }