ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/sun.c
(Generate patch)

Comparing ray/src/gen/sun.c (file contents):
Revision 2.3 by greg, Sat Feb 22 02:07:24 2003 UTC vs.
Revision 2.4 by schorsch, Sun Nov 16 10:29:38 2003 UTC

# Line 18 | Line 18 | double  s_meridian = 2.0944;   /* standard meridian (rad
18  
19  
20   int
21 < jdate(month, day)               /* Julian date (days into year) */
22 < int  month, day;
21 > jdate(          /* Julian date (days into year) */
22 >        int month,
23 >        int day
24 > )
25   {
26          static short  mo_da[12] = {0,31,59,90,120,151,181,212,243,273,304,334};
27          
# Line 28 | Line 30 | int  month, day;
30  
31  
32   double
33 < stadj(jd)               /* solar time adjustment from Julian date */
34 < int  jd;
33 > stadj(          /* solar time adjustment from Julian date */
34 >        int  jd
35 > )
36   {
37          return( 0.170 * sin( (4*PI/373) * (jd - 80) ) -
38                  0.129 * sin( (2*PI/355) * (jd - 8) ) +
# Line 38 | Line 41 | int  jd;
41  
42  
43   double
44 < sdec(jd)                /* solar declination angle from Julian date */
45 < int  jd;
44 > sdec(           /* solar declination angle from Julian date */
45 >        int  jd
46 > )
47   {
48          return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) );
49   }
50  
51  
52   double
53 < salt(sd, st)    /* solar altitude from solar declination and solar time */
54 < double  sd, st;
53 > salt(   /* solar altitude from solar declination and solar time */
54 >        double sd,
55 >        double st
56 > )
57   {
58          return( asin( sin(s_latitude) * sin(sd) -
59                          cos(s_latitude) * cos(sd) * cos(st*(PI/12)) ) );
# Line 55 | Line 61 | double  sd, st;
61  
62  
63   double
64 < sazi(sd, st)    /* solar azimuth from solar declination and solar time */
65 < double  sd, st;
64 > sazi(   /* solar azimuth from solar declination and solar time */
65 >        double sd,
66 >        double st
67 > )
68   {
69          return( -atan2( cos(sd)*sin(st*(PI/12)),
70                          -cos(s_latitude)*sin(sd) -

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines