|
|
1.1 ! root 1: #include "sky.h" ! 2: ! 3: output() ! 4: { ! 5: ! 6: printf("%s ",object); ! 7: ! 8: if(!((flags&GEO)||(flags&HELIO))){ ! 9: prhms(ra,3); ! 10: prdms(decl2,2); ! 11: printf(" %8.4f %8.4f %9.4f\n", az, el, semi2); ! 12: } ! 13: if((flags&GEO)){ ! 14: prhms(alpha,3); ! 15: prdms(delta,2); ! 16: printf(" %13.7f\n", georad); ! 17: } ! 18: if((flags&HELIO)){ ! 19: while(lambda<0) ! 20: lambda += 2.*pi; ! 21: while(lambda > 2.*pi) ! 22: lambda -= 2.*pi; ! 23: prdms(lambda,3); ! 24: prdms(beta,3); ! 25: printf(" %14.8f\n", rad); ! 26: } ! 27: } ! 28: ! 29: prhms(arg,n) ! 30: double arg; ! 31: int n; ! 32: { ! 33: int n1, n2; ! 34: double x; ! 35: char *format = " %2d %02d %07.4f"; ! 36: ! 37: format[14] = n + '0'; ! 38: format[12] = n + '3'; ! 39: while(arg < 0.) arg += 2.*pi; ! 40: arg /= 15.; ! 41: x = arg/radian; ! 42: n1 = floor(x); ! 43: x = (x-n1)*60.; ! 44: n2 = floor(x); ! 45: x = x - n2; ! 46: x = x * 60.; ! 47: printf(format, n1, n2, x); ! 48: } ! 49: ! 50: prdms(arg,n) ! 51: double arg; ! 52: int n; ! 53: { ! 54: int n1, n2; ! 55: double x; ! 56: int sign; ! 57: char *format1 = " %4d %02d %07.4f"; ! 58: char *format2 = " -0 %02d %07.4f"; ! 59: ! 60: format1[14] = n + '0'; ! 61: format1[12] = n + '3'; ! 62: format2[15] = n + '0'; ! 63: format2[13] = n + '3'; ! 64: if(arg<0.){ ! 65: arg = -arg; ! 66: sign = -1; ! 67: }else{ ! 68: sign = 1; ! 69: } ! 70: x = arg/radian; ! 71: n1 = floor(x); ! 72: x = (x-n1)*60.; ! 73: n2 = floor(x); ! 74: x -= n2; ! 75: x *= 60.; ! 76: n1 *= sign; ! 77: if((n1==0)&&(sign== -1)) ! 78: printf(format2, n2, x); ! 79: else ! 80: printf(format1, n1, n2, x); ! 81: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.