Lines Matching +full:double +full:- +full:phase
33 * Phase of the Moon. Calculates the current phase of the moon.
35 * by Duffett-Smith. Comments give the section from the book that
38 * -- Keith E. Brandt VIII 1984
67 static void adj360(double *);
68 static double dtor(double);
69 static double potm(double);
77 double days, today, tomorrow; in main()
89 while ((ch = getopt(argc, argv, "d:pt:")) != -1) in main()
104 argc -= optind; in main()
113 /* Save today in case -d isn't specified */ in main()
117 tmd.tm_year = strtol(odate, NULL, 10) - 1900; in main()
118 tmd.tm_mon = strtol(odate + 5, NULL, 10) - 1; in main()
124 tmd.tm_isdst = -1; in main()
130 tmd.tm_isdst = -1; in main()
171 * potm --
172 * return phase of the moon
174 static double
175 potm(double days) in potm()
177 double N, Msol, Ec, LambdaSol, l, Mm, Ev, Ac, A3, Mmprime; in potm()
178 double A4, lprime, V, ldprime, D, Nm; in potm()
182 Msol = N + EPSILONg - RHOg; /* sec 42 #4 */ in potm()
189 Mm = l - (0.1114041 * days) - Pzero; /* sec 61 #5 */ in potm()
191 Nm = Nzero - (0.0529539 * days); /* sec 61 #6 */ in potm()
193 Ev = 1.2739 * sin(dtor(2*(l - LambdaSol) - Mm)); /* sec 61 #7 */ in potm()
196 Mmprime = Mm + Ev - Ac - A3; /* sec 61 #9 */ in potm()
199 lprime = l + Ev + Ec - Ac + A4; /* sec 61 #12 */ in potm()
200 V = 0.6583 * sin(dtor(2 * (lprime - LambdaSol))); /* sec 61 #13 */ in potm()
202 D = ldprime - LambdaSol; /* sec 63 #2 */ in potm()
203 return(50 * (1 - cos(dtor(D)))); /* sec 63 #3 */ in potm()
207 * dtor --
210 static double
211 dtor(double deg) in dtor()
218 * adj360 --
222 adj360(double *deg) in adj360()
229 *deg -= 360; in adj360()
238 fprintf(stderr, "Usage: %s [-p] [-d yyyy.mm.dd] [-t hh:mm:ss]\n", in usage()