--- ray/src/gen/sun.c 1989/02/02 11:16:32 1.1 +++ ray/src/gen/sun.c 1992/10/02 16:12:29 2.2 @@ -1,14 +1,18 @@ -/* +/* Copyright (c) 1989 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; #endif + +/* * SOLAR CALCULATIONS * * 3/31/87 * */ +#include + #define PI 3.141592654 double s_latitude = 0.66; /* site latitude (radians) */ @@ -30,8 +34,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 ); @@ -42,8 +44,6 @@ double sdec(jd) /* solar declination angle from Julian date */ int jd; { - double sin(); - return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) ); } @@ -52,8 +52,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)) ) ); } @@ -63,8 +61,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)) ) );