1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
19 |
|
|
20 |
|
#include "color.h" |
21 |
|
|
22 |
– |
#ifndef atof |
23 |
– |
extern double atof(); |
24 |
– |
#endif |
22 |
|
extern char *strcpy(), *strcat(), *malloc(); |
23 |
|
extern double stadj(), sdec(), sazi(), salt(); |
24 |
|
|
147 |
|
st = hour + stadj(jd); |
148 |
|
altitude = salt(sd, st); |
149 |
|
azimuth = sazi(sd, st); |
150 |
+ |
printf("# Solar altitude and azimuth: %f %f\n", |
151 |
+ |
180./PI*altitude, 180./PI*azimuth); |
152 |
+ |
} |
153 |
+ |
if (!cloudy && altitude > 87.*PI/180.) { |
154 |
+ |
fprintf(stderr, |
155 |
+ |
"%s: warning - sun too close to zenith, reducing altitude to 87 degrees\n", |
156 |
+ |
progname); |
157 |
+ |
printf( |
158 |
+ |
"# warning - sun too close to zenith, reducing altitude to 87 degrees\n"); |
159 |
+ |
altitude = 87.*PI/180.; |
160 |
|
} |
161 |
|
sundir[0] = -sin(azimuth)*cos(altitude); |
162 |
|
sundir[1] = -cos(azimuth)*cos(altitude); |