6 double PI_180 = 0.0174532925199432957692369;
7 double TWOPI = 6.2831853071795864769252867665590057683943387987502;
8 double LN2 = 0.69314718055994530941723212145817656807550013436025;
9 static double angledangle=(180./PI)*MILLIARCSEC;
26 return angle*angledangle;
32 return dangle/angledangle;
36 rfloat(char *p, int n)
43 return rfloat(p+1, n-1);
45 return -rfloat(p+1, n-1);
57 d+=(*p++-'0')/(i*=10.);
77 x += 0.5/36000.; /* round up half of 0.1 sec */
87 sprint(buf, "%dh%.2dm%.2d.%ds", h, m, s, ts);
96 int sign, d, m, s, ts;
104 x += 0.5/36000.; /* round up half of 0.1 arcsecond */
114 sprint(buf, "%c%d°%.2d'%.2d.%d\"", sign, d, m, s, ts);
126 x += 0.5/36000.; /* round up half of 0.1 arcsecond */
137 sprint(buf, "%d°%.2d'%.2d.%d\"", d, m, s, ts);
139 sprint(buf, "%.2d'%.2d.%d\"", m, s, ts);
151 x += 0.5/600.; /* round up half of tenth of minute */
159 sprint(buf, "%dh%.2d.%1dm", h, m, n);
171 x += 2.5/60.; /* round up 2.5m */
177 sprint(buf, "%dh%.2dm", h, m);
194 x += 0.5/600.; /* round up half of tenth of arcminute */
202 sprint(buf, "%c%d°%.2d.%.1d'", sign, d, m, n);
219 x += 0.5; /* round up half degree */
221 sprint(buf, "%c%d°", sign, d);
226 getword(char *ou, char *in)
232 if(c == ' ' || c == '\t')
241 if(c >= 'A' && c <= 'Z')
253 if(c >= 'A' && c <= 'Z')
257 if(c == ' ' || c == '\t' || c == 0) {
265 * Read formatted angle. Must contain no embedded blanks
280 if(*p == ' ' || *p=='\0')
295 p += chartorune(&r, p);
334 dist(Angle ra1, Angle dec1, Angle ra2, Angle dec2)
338 a = sin(dec1) * sin(dec2) +
339 cos(dec1) * cos(dec2) *
341 a = atan2(xsqrt(1 - a*a), a);
356 if(gam.absgamma == 1)
359 c = exp(log(f*gam.mult1) * gam.absgamma) * 255;