8 a = sin(p->decl2)*sin(q->decl2) +
9 cos(p->decl2)*cos(q->decl2)*cos(p->ra-q->ra);
10 a = fabs(atan2(pyth(a), a)) / radsec;
19 static char buf[1024];
20 static int bc, bn, bf;
29 bn = read(bf, buf, sizeof(buf));
47 if(i < 0 || i > NPTS+1)
49 t = osun.point[i].el +
50 (t-i)*(osun.point[i+1].el - osun.point[i].el);
55 rise(Obj2 *op, double el)
63 for(i=0; i<=NPTS; i++) {
66 if(i >= 1 && e1 <= el && e2 > el)
72 return i - 1 + (el-e1)/(e2-e1);
76 set(Obj2 *op, double el)
84 for(i=0; i<=NPTS; i++) {
87 if(i >= 1 && e1 > el && e2 <= el)
93 return i - 1 + (el-e1)/(e2-e1);
106 for(i=0; i<=NPTS; i++) {
108 d2 = osun.point[i].ra;
114 if(i >= 1 && d3 >= d1 && d3 < d2)
120 return i - (d3-d2)/(d1-d2);
130 for(i=0; i<=NPTS; i++) {
132 d2 = osun.point[i].mag;
133 if(i >= 1 && b >= d1 && b < d2)
139 return i - (b-d2)/(d1-d2);
152 for(i=0; i<=NPTS; i++) {
155 d3 = dist(&p->point[i], &osun.point[i]);
156 if(i >= 2 && d2 >= d1 && d2 >= d3)
166 Event events[NEVENT];
170 event(char *format, char *arg1, char *arg2, double tim, int flag)
183 if(p >= events+NEVENT) {
184 fprint(2, "too many events\n");
202 qsort(events, eventp-events, sizeof *p, evcomp);
203 for(p = events; p<eventp; p++) {
204 if((p->flag&SIGNIF) && flags['s'])
205 print("ding ding ding ");
206 print(p->format, p->arg1, p->arg2);
208 ptime(day + p->tim*deld);
215 evcomp(void *a1, void *a2)
224 if(p1->flag & SIGNIF)
226 if(p2->flag & SIGNIF)
253 while(*cp == ' ' || *cp == '\t')
255 while(*cp != '\n' && *cp != ' ' && *cp != '\t')
258 while(*cp == ' ' || *cp == '\t')