--- ray/src/gen/sun.c 1991/11/12 17:04:42 2.1 +++ ray/src/gen/sun.c 2003/02/22 02:07:24 2.3 @@ -1,9 +1,6 @@ -/* Copyright (c) 1989 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: sun.c,v 2.3 2003/02/22 02:07:24 greg Exp $"; #endif - /* * SOLAR CALCULATIONS * @@ -11,6 +8,8 @@ static char SCCSid[] = "$SunId$ LBL"; * */ +#include + #define PI 3.141592654 double s_latitude = 0.66; /* site latitude (radians) */ @@ -32,8 +31,6 @@ double stadj(jd) /* solar time adjustment from Julian date */ int jd; { - double sin(); - return( 0.170 * sin( (4*PI/373) * (jd - 80) ) - 0.129 * sin( (2*PI/355) * (jd - 8) ) + 12 * (s_meridian - s_longitude) / PI ); @@ -44,8 +41,6 @@ double sdec(jd) /* solar declination angle from Julian date */ int jd; { - double sin(); - return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) ); } @@ -54,8 +49,6 @@ double salt(sd, st) /* solar altitude from solar declination and solar time */ double sd, st; { - double sin(), cos(), asin(); - return( asin( sin(s_latitude) * sin(sd) - cos(s_latitude) * cos(sd) * cos(st*(PI/12)) ) ); } @@ -65,8 +58,6 @@ double sazi(sd, st) /* solar azimuth from solar declination and solar time */ double sd, st; { - double sin(), cos(), atan2(); - return( -atan2( cos(sd)*sin(st*(PI/12)), -cos(s_latitude)*sin(sd) - sin(s_latitude)*cos(sd)*cos(st*(PI/12)) ) );