--- ray/src/gen/sun.c 2003/02/22 02:07:24 2.3 +++ ray/src/gen/sun.c 2003/11/16 10:29:38 2.4 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: sun.c,v 2.3 2003/02/22 02:07:24 greg Exp $"; +static const char RCSid[] = "$Id: sun.c,v 2.4 2003/11/16 10:29:38 schorsch Exp $"; #endif /* * SOLAR CALCULATIONS @@ -18,8 +18,10 @@ double s_meridian = 2.0944; /* standard meridian (rad int -jdate(month, day) /* Julian date (days into year) */ -int month, day; +jdate( /* Julian date (days into year) */ + int month, + int day +) { static short mo_da[12] = {0,31,59,90,120,151,181,212,243,273,304,334}; @@ -28,8 +30,9 @@ int month, day; double -stadj(jd) /* solar time adjustment from Julian date */ -int jd; +stadj( /* solar time adjustment from Julian date */ + int jd +) { return( 0.170 * sin( (4*PI/373) * (jd - 80) ) - 0.129 * sin( (2*PI/355) * (jd - 8) ) + @@ -38,16 +41,19 @@ int jd; double -sdec(jd) /* solar declination angle from Julian date */ -int jd; +sdec( /* solar declination angle from Julian date */ + int jd +) { return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) ); } double -salt(sd, st) /* solar altitude from solar declination and solar time */ -double sd, st; +salt( /* solar altitude from solar declination and solar time */ + double sd, + double st +) { return( asin( sin(s_latitude) * sin(sd) - cos(s_latitude) * cos(sd) * cos(st*(PI/12)) ) ); @@ -55,8 +61,10 @@ double sd, st; double -sazi(sd, st) /* solar azimuth from solar declination and solar time */ -double sd, st; +sazi( /* solar azimuth from solar declination and solar time */ + double sd, + double st +) { return( -atan2( cos(sd)*sin(st*(PI/12)), -cos(s_latitude)*sin(sd) -