Lines Matching +full:1 +full:d

10  * 1. Redistributions of source code must retain the above copyright
81 fixup(double *d) in fixup() argument
84 if (*d < 0) { in fixup()
85 while (*d < 0) in fixup()
86 *d += 360; in fixup()
88 while (*d > 360) in fixup()
89 *d -= 360; in fixup()
92 return (*d); in fixup()
103 double ZJ, D, T, M, epsilon, lambda, alpha, HA, UTHM; in sunpos() local
110 Y = inYY - 1900; /* 1 */ in sunpos()
111 D = floor(365.25 * Y) + ZJ + inDD + UTHM / FHOURSPERDAY; /* 3 */ in sunpos()
112 T = D / 36525.0; /* 4 */ in sunpos()
126 int lssign = sin(D2R(lambda)) < 0 ? -1 : 1; in sunpos()
127 int lcsign = cos(D2R(lambda)) < 0 ? -1 : 1; in sunpos()
128 while (((sin(D2R(alpha)) < 0) ? -1 : 1) != lssign in sunpos()
129 || ((cos(D2R(alpha)) < 0) ? -1 : 1) != lcsign) in sunpos()
141 printf("%02d/%02d %02d:%02d:%02d l:%g d:%g h:%g\n", in sunpos()
165 printf("Y:\t\t\t %d\t\t %d\t\t %d\n", Y, expY, Y - expY); in sunpos()
168 comp("D", D, expD); in sunpos()
185 #define SIGN(a) (((a) > 180) ? -1 : 1)
186 #define ANGLE(a, b) (((a) < (b)) ? 1 : -1)
193 #define DEBUG1(y, m, d, hh, mm, pdec, dec) \ argument
194 printf("%4d-%02d-%02d %02d:%02d:00 - %7.7g -> %7.7g\n", \
195 y, m, d, hh, mm, pdec, dec)
196 #define DEBUG2(y, m, d, hh, mm, pdec, dec, pang, ang) \ argument
197 printf("%4d-%02d-%02d %02d:%02d:00 - %7.7g -> %7.7g - %d -> %d\n", \
198 y, m, d, hh, mm, pdec, dec, pang, ang)
206 equinoxdays[1] = round(fe[1]); in equinoxsolstice()
208 solsticedays[1] = round(fs[1]); in equinoxsolstice()
215 int h, d, prevangle, angle; in fequinoxsolstice() local
229 for (d = 18; d < 31; d++) { in fequinoxsolstice()
230 /* printf("Comparing day %d to %d.\n", d, d+1); */ in fequinoxsolstice()
231 sunpos(year, 3, d, UTCoffset, 0, 0, 0, 0.0, 0.0, &L, &decleft); in fequinoxsolstice()
232 sunpos(year, 3, d + 1, UTCoffset, 0, 0, 0, 0.0, 0.0, in fequinoxsolstice()
241 /* printf("Obtaining %d (%02d:%02d)\n", in fequinoxsolstice()
243 sunpos(year, 3, d, UTCoffset, in fequinoxsolstice()
260 equinoxdays[0] = 1 + cumdays[3] + d + (dial / FSECSPERDAY); in fequinoxsolstice()
268 for (d = 18; d < 31; d++) { in fequinoxsolstice()
269 /* printf("Comparing day %d to %d.\n", d, d+1); */ in fequinoxsolstice()
270 sunpos(year, 9, d, UTCoffset, 0, 0, 0, 0.0, 0.0, &L, &decleft); in fequinoxsolstice()
271 sunpos(year, 9, d + 1, UTCoffset, 0, 0, 0, 0.0, 0.0, in fequinoxsolstice()
280 /* printf("Obtaining %d (%02d:%02d)\n", in fequinoxsolstice()
282 sunpos(year, 9, d, UTCoffset, in fequinoxsolstice()
299 equinoxdays[1] = 1 + cumdays[9] + d + (dial / FSECSPERDAY); in fequinoxsolstice()
310 prevangle = 1; in fequinoxsolstice()
311 for (d = 18; d < 31; d++) { in fequinoxsolstice()
313 sunpos(year, 6, d, UTCoffset, HOUR(h), MIN(h), SEC(h), in fequinoxsolstice()
318 DEBUG2(year, 6, d, HOUR(h), MIN(h), in fequinoxsolstice()
321 solsticedays[0] = 1 + cumdays[6] + d + in fequinoxsolstice()
323 found = 1; in fequinoxsolstice()
340 prevangle = -1; in fequinoxsolstice()
341 for (d = 18; d < 31; d++) { in fequinoxsolstice()
343 sunpos(year, 12, d, UTCoffset, HOUR(h), MIN(h), SEC(h), in fequinoxsolstice()
348 DEBUG2(year, 12, d, HOUR(h), MIN(h), in fequinoxsolstice()
351 solsticedays[1] = 1 + cumdays[12] + d + in fequinoxsolstice()
353 found = 1; in fequinoxsolstice()
369 int m, d, h; in calculatesunlongitude30() local
373 int firstmonth330 = -1; in calculatesunlongitude30()
380 sunpos(year - 1, 12, 31, in calculatesunlongitude30()
384 for (m = 1; m <= 12; m++) { in calculatesunlongitude30()
385 for (d = 1; d <= monthdays[m]; d++) { in calculatesunlongitude30()
387 sunpos(year, m, d, in calculatesunlongitude30()
392 *pichinesemonths = cumdays[m] + d; in calculatesunlongitude30()
394 printf("%04d-%02d-%02d %02d:%02d - %d %g\n", in calculatesunlongitude30()
395 year, m, d, HOUR(h), MIN(h), *pichinesemonths, curL); in calculatesunlongitude30()
402 cumdays[m] + d; in calculatesunlongitude30()
404 printf("%04d-%02d-%02d %02d:%02d - %d %g\n", in calculatesunlongitude30()
405 year, m, d, HOUR(h), MIN(h), *pichinesemonths, curL); in calculatesunlongitude30()
416 *pichinesemonths = -1; in calculatesunlongitude30()
444 equinoxsolstice(strtol(argv[1], NULL, 10), 0.0, eq, sol); in main()
445 printf("%d - %d - %d - %d\n", eq[0], sol[0], eq[1], sol[1]); in main()