home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume30 / astrolog / part01 < prev    next >
Encoding:
Text File  |  1992-06-18  |  48.5 KB  |  1,292 lines

  1. Newsgroups: comp.sources.misc
  2. From: cruiser1@u.washington.edu (Walter D. Pullen)
  3. Subject:  v30i062:  astrolog - Generation of astrology charts v2.25, Part01/08
  4. Message-ID: <csm-v30i062=astrolog.135419@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 9d00334bbf48006d5c04e6c2d233d6da
  6. Date: Thu, 18 Jun 1992 18:54:43 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: cruiser1@u.washington.edu (Walter D. Pullen)
  10. Posting-number: Volume 30, Issue 62
  11. Archive-name: astrolog/part01
  12. Environment: UNIX, VMS
  13. Supersedes: astrolog: Volume 28, Issue 104-109
  14.  
  15. Astrolog is an astrology calculation program written in C. Its main
  16. function is to calculate birthcharts and give accurate positions of
  17. planets, various asteroids, stars, and house positions at particular
  18. times, but it also supports different display formats, forms of chart
  19. comparisons, and other astrology related functions, including graphics
  20. charts and animation for X11.
  21.  
  22. Some of the additions made to Astrolog 2.25 over the previous version
  23. that was posted here earlier are: Fixed star positions, spatial
  24. astronomical charts of the solar system, new kinds and more support
  25. for relationship charts, and the beginnings of an interpretation
  26. feature. Ability to scan a data file for program defaults has been
  27. added, allowing changes to be made without recompiling, along with a
  28. bunch of additions to the graphics features.
  29.  
  30. Astrolog works best when run on a Unix system with X windows, however
  31. neither Unix nor X11 are needed in order to be able to run the
  32. program. The X11 features can easily be compiled out for those who
  33. don't have them, and various users have gotten this and previous
  34. versions of the program compiled properly on VMS, MS-DOS, and Mac
  35. systems with only a couple of modifications necessary, most of those
  36. changes of which I have tried to include in this version of the code.
  37.  
  38. #! /bin/sh
  39. # This is a shell archive.  Remove anything before this line, then unpack
  40. # it by saving it into a file and typing "sh file".  To overwrite existing
  41. # files, type "sh file -c".  You can also feed this as standard input via
  42. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  43. # will see the following message at the end:
  44. #        "End of archive 1 (of 8)."
  45. # Contents:  README Makefile astrolog.dat astrolog.h data.c MANIFEST
  46. # Wrapped by cruiser1@milton.u.washington.edu on Thu Jun 11 21:53:36 1992
  47. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  48. if test -f 'README' -a "${1}" != "-c" ; then 
  49.   echo shar: Will not clobber existing file \"'README'\"
  50. else
  51. echo shar: Extracting \"'README'\" \(3863 characters\)
  52. sed "s/^X//" >'README' <<'END_OF_FILE'
  53. X************************************************************************
  54. X
  55. XAstrolog version 2.25 (June 1992)
  56. X
  57. XAstrolog (pronounced astro-log; astro as in astronomy, log as is
  58. Xlogarithm) is an astrology calculation program written in C. Its main
  59. Xfunction is to calculate birthcharts and give accurate positions of
  60. Xplanets, various asteroids, stars, and house positions at particular
  61. Xtimes, but it also supports different display formats, forms of chart
  62. Xcomparisons, and other astrology related functions, including graphics
  63. Xcharts and animation for X11.
  64. X
  65. XAstrolog works best when run on a Unix system with X windows, however
  66. Xneither Unix nor X11 are needed in order to be able to run the
  67. Xprogram. The X11 features can easily be compiled out for those who
  68. Xdon't have them, and various users have gotten this and previous
  69. Xversions of the program compiled properly on VMS, MS-DOS, and Mac
  70. Xsystems with only a couple of modifications necessary, most of those
  71. Xchanges of which I have tried to include in this version of the code.
  72. X
  73. XIMPORTANT: The planetary calculation routines used in this program
  74. Xhave been Copyrighted and the core of this program is basically a
  75. Xconversion to C of the routines created by James Neely as listed in
  76. XMichael Erlewine's 'Manual of Computer Programming for Astrologers',
  77. Xavailable from Matrix Software. The copyright gives us permission to
  78. Xuse the routines for our own purposes but not to sell them or profit
  79. Xfrom them in any way.
  80. X
  81. XIN ADDITION: the graphics database and chart display routines used in
  82. Xthis program are Copyright (C) 1991-1992 by Walter D. Pullen. Permission
  83. Xis granted to freely use and distribute these routines provided one
  84. Xdoesn't sell, restrict, or profit from them in any way.  Modification
  85. Xis allowed provided these notices remain with any altered or edited
  86. Xversions of the program.
  87. X
  88. XTo compile this version 2.25, first edit the top of the file
  89. Xastrolog.h, putting in your own appropriate values for the default
  90. Xlongitude, latitude, time zone, and default search directory. (In the
  91. Xsame manner, also edit the default paramater values in the file
  92. Xastrolog.dat.) Also comment out any of the #defines which set various
  93. Xfeatures that aren't valid on your system, such as the X11, TIME, and
  94. XSWITCHES variables, and edit or comment out the DEFAULT_SYSTEM and
  95. XASTEROIDS variables to your tastes. Then, for unix systems, run the
  96. Xcommand 'make' on the Makefile (or you can always compile by hand: "cc
  97. X-O -c *.c; cc -o astrolog *.o -lm -lX11" will do it; just make sure to
  98. Xcompile each source file and link them together at the end with the
  99. Xmath and X11 libraries.)
  100. X
  101. XNote: The file 'Helpfile' that comes with this distribution is a ~100K
  102. Xfile that lists lots of information about the program and how to use
  103. Xthe different features and options, which you will want to read. Due
  104. Xto its length, that file had to be split into two parts: Helpfile.p1
  105. Xand Helpfile.p2 - You will want to concatenate these parts back
  106. Xtogether again. Use your favorite editor to do this, or if you are on
  107. Xa unix system, do the command: cat Helpfile.p1 Helpfile.p2 > Helpfile.
  108. XThe file 'History' is also a lengthy file split into two parts which
  109. Xshould be recombined in the same manner.
  110. X
  111. XEnjoy the program! May you have as much fun with it as I have. Send
  112. Xcomments to my e-mail address below.
  113. X
  114. X-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
  115. X|    Walter D. "Cruiser1" Pullen    |    cruiser1@milton.u.washington.edu.    |
  116. X-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
  117. X|   "Who am I, What am I?  As I am, I am not.  But as we are, I AM.  And to   |
  118. X-   you my creation, My Perfect Love is your Perfect Freedom. And I will be   -
  119. X|   with you forever and ever, until the End, and then forever more." - GOD   |
  120. X-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
  121. END_OF_FILE
  122. if test 3863 -ne `wc -c <'README'`; then
  123.     echo shar: \"'README'\" unpacked with wrong size!
  124. fi
  125. # end of 'README'
  126. fi
  127. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  128.   echo shar: Will not clobber existing file \"'Makefile'\"
  129. else
  130. echo shar: Extracting \"'Makefile'\" \(744 characters\)
  131. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  132. X# Makefile for Unix Astrolog version 2.25 (cruiser1@milton.u.washington.edu)
  133. X# First created 11/21/1991
  134. X#
  135. X# This Makefile is included only for convenience. One could easily compile
  136. X# Astrolog on a Unix system by hand with the command:
  137. X# % cc -c *.c; cc -o astrolog *.o -lm -lX11
  138. X#
  139. X# Generally, all that needs to be done to compile once astrolog.h has been
  140. X# edited, is compile each source file, and link them together with the math
  141. X# library, and if applicable, the main X library.
  142. X#
  143. XNAME = astrolog
  144. XOBJ = data.o formulas.o charts.o options.o xcharts.o graphics.o driver.o
  145. X# If you don't have X windows, delete the "-lX11" part from the line below:
  146. XLIBS = -lm -lX11
  147. XCFLAGS = -O
  148. X
  149. Xastrolog:: $(OBJ)
  150. X    cc -o $(NAME) $(OBJ) $(LIBS)
  151. X    strip $(NAME)
  152. X#
  153. END_OF_FILE
  154. if test 744 -ne `wc -c <'Makefile'`; then
  155.     echo shar: \"'Makefile'\" unpacked with wrong size!
  156. fi
  157. # end of 'Makefile'
  158. fi
  159. if test -f 'astrolog.dat' -a "${1}" != "-c" ; then 
  160.   echo shar: Will not clobber existing file \"'astrolog.dat'\"
  161. else
  162. echo shar: Extracting \"'astrolog.dat'\" \(680 characters\)
  163. sed "s/^X//" >'astrolog.dat' <<'END_OF_FILE'
  164. XAstrolog 2.25 default parameter file.
  165. X
  166. XDEFAULT TIME AND PLACE:
  167. XTime zone = 8
  168. XLongitude = 122.20
  169. XLatitude  = 47.36
  170. X
  171. XDEFAULT VALUES:
  172. XNo. Aspects  = 5
  173. XHouse system = 0
  174. X
  175. XDEFAULT RESTRICTIONS:
  176. XRow 1: Planets; Row 2: Minor planets. =
  177. X0 0 0 0 0 0 0 0 0 0
  178. X0 0 0 0 0 0 0 0 0 0
  179. X
  180. XDEFAULT ASPECT ORBS:
  181. XRow 1: Majors; Row 2: Minors; Row 3; Obscure. =
  182. X7 7 7 7 6
  183. X3 3 3 3 2 2
  184. X1 1 1 1 1 1 1
  185. X
  186. XDEFAULT INFLUENCES:
  187. XRow 1: Planets; Row 2: Minor planets; Row 3: Houses;
  188. XRow 4: Major aspects; Row 5: Minor aspects; Row 6; Obscure aspects. =
  189. X30 25 10 10 10 10 10 10 10 10
  190. X  5 5 5 5 5 5 5 15 20 5
  191. X20 0 0 10 0 0 5 0 0 15 0 0
  192. X1.0 0.8 0.8 0.6 0.6
  193. X  0.4 0.4 0.2 0.2 0.2 0.2
  194. X  0.1 0.1 0.1 0.1 0.1 0.1 0.1
  195. X
  196. XEOF
  197. END_OF_FILE
  198. if test 680 -ne `wc -c <'astrolog.dat'`; then
  199.     echo shar: \"'astrolog.dat'\" unpacked with wrong size!
  200. fi
  201. # end of 'astrolog.dat'
  202. fi
  203. if test -f 'astrolog.h' -a "${1}" != "-c" ; then 
  204.   echo shar: Will not clobber existing file \"'astrolog.h'\"
  205. else
  206. echo shar: Extracting \"'astrolog.h'\" \(9411 characters\)
  207. sed "s/^X//" >'astrolog.h' <<'END_OF_FILE'
  208. X/*
  209. X** Astrolog (Version 2.25) File: astrolog.h
  210. X** By Walter D. Pullen (cruiser1@milton.u.washington.edu)
  211. X** Programmed 8/28,30, 9/10,13,16,20,23, 10/3,6,7, 11/7,10,21/1991.
  212. X** Last revision made 6/2/1992.
  213. X** Eighth version posted to newsgroup alt.astrology.
  214. X**
  215. X** IMPORTANT: The planetary calculation routines used in this program
  216. X** have been Copyrighted and the core of this program is basically a
  217. X** conversion to C of the routines created by James Neely as listed in
  218. X** Michael Erlewine's 'Manual of Computer Programming for Astrologers',
  219. X** available from Matrix Software. The copyright gives us permission to
  220. X** use the routines for our own purposes but not to sell them or profit
  221. X** from them in any way.
  222. X**
  223. X** IN ADDITION: the graphics database and chart display routines used in
  224. X** this program are Copyright (C) 1991-1992 by Walter D. Pullen. Permission
  225. X** is granted to freely use and distribute these routines provided one
  226. X** doesn't sell, restrict, or profit from them in any way. Modification
  227. X** is allowed provided these notices remain with any altered or edited
  228. X** versions of the program.
  229. X*/
  230. X
  231. X/*
  232. X** To compile: For most systems, especially Unix based ones, the only changes
  233. X** that should need to be made to the code are to edit or (un)comment the eight
  234. X** #define's below to equal the particulars of your own locale and system:
  235. X*/
  236. X
  237. X#define DEFAULT_LONG 122.20  /* Change these values to the longitude W and */
  238. X#define DEFAULT_LAT   47.36  /* latitude N of your current location.       */
  239. X#define DEFAULT_ZONE   8.00  /* Change to default time zone of current     */
  240. X                             /* location in hours before (west of) GMT.    */
  241. X
  242. X#define DEFAULT_DIR "/u4/cruiser1/ast/etc/"
  243. X                     /* Change this string to directory path program       */
  244. X                     /* should look in for chart files if not in current.  */
  245. X
  246. X#define SWITCHES /* Comment out this #define if your system can not handle */
  247. X                 /* parameters on the command line (like Mac's, etc.)      */
  248. X#define TIME     /* Comment out this #define if your compiler can't take   */
  249. X                 /* the calls to 'time' or 'localtime' as in time.h        */
  250. X#define X11      /* Comment out this #define if you don't have X windows.  */
  251. X#define UNIX     /* Comment out this #define if you have a VMS system or   */
  252. X                 /* a system in which atof() isn't defined in stdio.h      */
  253. X
  254. X/*
  255. X** Although not necessary, one may like to change some of the values below:
  256. X** These constants affect some of the default parameters, e.g. fonts, etc.
  257. X*/
  258. X
  259. X#define DEFAULT_INFOFILE "astrolog.dat" /* Name of file to look in for     */
  260. X                                        /* default parameters (which may   */
  261. X                                        /* override the values here.)      */
  262. X#define ASTEROIDS            /* Comment out this #define if you don't want */
  263. X                             /* Chiron, the asteroids, the part of         */
  264. X                             /* fortune, and vertex to appear by default.  */
  265. X#define DEFAULT_SYSTEM 0     /* Normally, Placidus houses are used (unless */
  266. X                             /* user specifies otherwise). If you want a   */
  267. X                             /* different default system, change this numb */
  268. X                             /* to value from 0..9 (values same as in -c). */
  269. X
  270. X#define WHEELCOLS 15    /* Affects the width of each house in wheel display */
  271. X#define WHEELROWS  4    /* Max no. of objects that can be in a wheel house. */
  272. X#define MAXINDAY 100    /* Max number of aspects or transits displayable.   */
  273. X#define MAXCROSS 500    /* Max number of latitude crossings displayable.    */
  274. X#define DIVISIONS 24    /* Greater numbers == more accuracy but slower      */
  275. X                        /* calculation, of exact aspect and transit times.  */
  276. X
  277. X#ifdef X11
  278. X#define BITMAPMODE 'C'  /* For X windows, this char affects how bitmaps are */
  279. X                        /* written. 'B' is written like with the 'bitmap'   */
  280. X                        /* program, 'C' is compacted somewhat (files have   */
  281. X                        /* less spaces), and 'S' is compacted even more.    */
  282. X#define FONT "6x10"     /* Font to use when writing in X window.            */
  283. X#define FONT_X   6      /* Font_x and Font_y should be set to the pixel     */
  284. X#define FONT_Y  10      /* width and height of the (fixed) font chosen.     */
  285. X#define BITMAPX 1152    /* Maximum window size allowed */
  286. X#define BITMAPY 1152
  287. X#define BITMAPX1 180    /* Minimum window size allowed */
  288. X#define BITMAPY1 180
  289. X#define DEFAULTX 600    /* Default window size         */
  290. X#define DEFAULTY 600
  291. X#define CELLSIZE  14    /* Size for each cell in the aspect grid      */
  292. X#define DEFORB   7.0    /* Min distance glyphs can be from each other */
  293. X#endif
  294. X
  295. X
  296. X/*
  297. X** One shouldn't need to change anything below this line to compile.
  298. X*/
  299. X
  300. X#include <stdio.h>
  301. X#ifndef UNIX
  302. X#include <stdlib.h>
  303. X#endif
  304. X#include <math.h>
  305. X#ifdef TIME
  306. X#include <time.h>
  307. X#endif
  308. X#ifdef X11
  309. X#include <X11/Xlib.h>
  310. X#include <X11/Xutil.h>
  311. X#endif
  312. X
  313. X
  314. X/*
  315. X*******************************************************************************
  316. X** Standard constants
  317. X*******************************************************************************
  318. X*/
  319. X
  320. X#define VERSION "2.25"
  321. X#define DATE "June 1992"
  322. X#define FALSE 0
  323. X#define TRUE 1
  324. X#define OFF 0
  325. X#define ON 1
  326. X#define STRING 80
  327. X#define PI 3.14159265358979323846
  328. X#define DEGREES 360.0
  329. X#define DEGTORAD (180.0/PI)
  330. X#define SIGNS    12
  331. X#define PLANETS  14
  332. X#define THINGS   16
  333. X#define OBJECTS  20
  334. X#define URANIANS 8
  335. X#define STARS    46
  336. X#define BASE     (OBJECTS+4+URANIANS)
  337. X#define TOTAL    (BASE+STARS)
  338. X#define ASPECTS  18
  339. X#define SYSTEMS  10
  340. X
  341. X
  342. X/*
  343. X*******************************************************************************
  344. X** Macro functions
  345. X*******************************************************************************
  346. X*/
  347. X
  348. X#define MAX(A, B) ((A) > (B) ? (A) : (B))
  349. X#define MIN(A, B) ((A) < (B) ? (A) : (B))
  350. X#define CAP(B) ((B) >= 'a' && (B) <= 'z' ? (B) - 'a' + 'A' : (B))
  351. X#define DTOR(A) ((A)/DEGTORAD)
  352. X#define RTOD(A) ((A)*DEGTORAD)
  353. X#define ASIN(A) atan((A)/sqrt(1.0-(A)*(A)))
  354. X#define ACOS(A) atan(sqrt(1.0-(A)*(A))/(A))
  355. X#define SIND(A) sin((A)/DEGTORAD)
  356. X#define COSD(A) cos((A)/DEGTORAD)
  357. X
  358. X#define SIGNAM(A) signname[A][0], signname[A][1], signname[A][2]
  359. X#define OBJNAM(A) objectname[A][0], objectname[A][1], objectname[A][2]
  360. X#define int long
  361. X#define ecltoequ(Z, L) coorxform(Z, L, DTOR(23.44578889))
  362. X#define equtoecl(Z, L) coorxform(Z, L, DTOR(-23.44578889))
  363. X#define equtolocal(Z, L, T) coorxform(Z, L, T)
  364. X
  365. X#ifdef X11
  366. X#define color unsigned long
  367. X#define bit   color
  368. X#define Xcolor(A) XSetForeground(disp, gc, A);
  369. X#endif
  370. X
  371. X
  372. X/*
  373. X*******************************************************************************
  374. X** External declarations
  375. X*******************************************************************************
  376. X*/
  377. X
  378. X/* From data.c */
  379. X
  380. Xextern FILE *data;
  381. Xextern char *filename, *filename2;
  382. X
  383. Xextern int total, objects, aspects, stars, universe,
  384. X  siderial, right, centerplanet, todisplay, housesystem, cusp, uranian,
  385. X  multiplyfactor, onasc, flip, decan, geodetic, graphstep,
  386. X  progress, autom, relation, operation;
  387. Xextern double progday, defzone, deflong, deflat, modulus;
  388. Xextern double Mon, Day, Yea, Tim, Zon, Lon, Lat,
  389. X  M, D, Y, F, X, L5, LA,
  390. X  SD, Mon2, Yea2, Delta, T, JD, Jdp,
  391. X  MC, Asc, Vtx;
  392. X
  393. Xextern double planet[], planetalt[], house[], ret[],
  394. X  spacex[], spacey[], spacez[],
  395. X  planet1[], planet2[], planetalt1[], planetalt2[],
  396. X  house1[], house2[], ret1[], ret2[];
  397. Xextern int inhouse[], ignore[], starname[], errorcount[];
  398. X
  399. Xextern char *signname[], signabbrev[][3], objectname[][12],
  400. X  uranianname[][10], *systemname[],
  401. X  *aspectname[], aspectabbrev[][4], *aspectglyph[], 
  402. X  *element[], *mode[], post[][3], *monthname[], *starnames[];
  403. Xextern double aspectangle[], aspectorb[], starbright[];
  404. Xextern int ruler1[], ruler2[], exalt[],
  405. X  grid[TOTAL+1][TOTAL+1], gridname[TOTAL+1][TOTAL+1],
  406. X  inhouse1[TOTAL+1], inhouse2[TOTAL+1];
  407. Xextern char *signdraw[], *objectdraw[], *housedraw[], *aspectdraw[];
  408. X
  409. Xextern void swapint(), swapdoub(), toofew(),
  410. X  printminute(), printaltitude(), inputdata();
  411. Xextern int stringlen(), mod12(), dayinmonth(),
  412. X  readworlddata();
  413. Xextern double dabs(), sgn(), dectodeg(), mod(), mindistance(), midpoint(),
  414. X  orb(), readplanetdata(), readstardata();
  415. Xextern char dignify(), *stringlocation();
  416. X
  417. X/* From formulas.c */
  418. X
  419. Xextern double mdytojulian(), processinput(), castchart();
  420. Xextern void juliantomdy(), coorxform(), houseplace(), caststar();
  421. X
  422. X/* From charts.c */
  423. X
  424. Xextern double objectinf[], houseinf[], aspectinf[];
  425. X
  426. Xextern void chartlocation(), chartgrid(), displaygrands(), chartwheel(),
  427. X  charthorizon(), chartspace(), chartinfluence(), chartastrograph();
  428. X
  429. X/* From options.c */
  430. X
  431. Xextern void creategrid(), castrelation(), printtransit(), printephemeris(),
  432. X  printchart();
  433. X
  434. X#ifdef X11
  435. X/* From graphics.c */
  436. X
  437. Xextern void xchart();
  438. X
  439. X/* From graphics.c */
  440. X
  441. Xextern color maincolor[], rainbowcolor[],
  442. X  elemcolor[], aspectcolor[], objectcolor[], hilite, gray, on, off;
  443. Xextern Display *disp;
  444. Xextern Pixmap pixmap;
  445. Xextern GC gc;
  446. Xextern Window window;
  447. Xextern char modex;
  448. Xextern int xcolor, xreverse, xbitmap, xtext, bonus, label,
  449. X  turtlex, turtley, scale, chartx, charty, degree, xnow;
  450. Xextern double tilt;
  451. Xextern void drawpoint(), block(), rect(), drawline(), drawclip(), turtle();
  452. X
  453. Xextern void xdisplayswitches(), xaction();
  454. Xextern int xprocess();
  455. X#endif
  456. X
  457. X/**/
  458. END_OF_FILE
  459. if test 9411 -ne `wc -c <'astrolog.h'`; then
  460.     echo shar: \"'astrolog.h'\" unpacked with wrong size!
  461. fi
  462. # end of 'astrolog.h'
  463. fi
  464. if test -f 'data.c' -a "${1}" != "-c" ; then 
  465.   echo shar: Will not clobber existing file \"'data.c'\"
  466. else
  467. echo shar: Extracting \"'data.c'\" \(27430 characters\)
  468. sed "s/^X//" >'data.c' <<'END_OF_FILE'
  469. X/*
  470. X** Astrolog (Version 2.25) File: data.c
  471. X**
  472. X** IMPORTANT: The planetary calculation routines used in this program
  473. X** have been Copyrighted and the core of this program is basically a
  474. X** conversion to C of the routines created by James Neely as listed in
  475. X** Michael Erlewine's 'Manual of Computer Programming for Astrologers',
  476. X** available from Matrix Software. The copyright gives us permission to
  477. X** use the routines for our own purposes but not to sell them or profit
  478. X** from them in any way.
  479. X**
  480. X** IN ADDITION: the graphics database and chart display routines used in
  481. X** this program are Copyright (C) 1991-1992 by Walter D. Pullen. Permission
  482. X** is granted to freely use and distribute these routines provided one
  483. X** doesn't sell, restrict, or profit from them in any way. Modification
  484. X** is allowed provided these notices remain with any altered or edited
  485. X** versions of the program.
  486. X*/
  487. X
  488. X#include "astrolog.h"
  489. X
  490. X/*
  491. X*******************************************************************************
  492. X** Global variables
  493. X*******************************************************************************
  494. X*/
  495. X
  496. XFILE *data;
  497. Xchar *filename, *filename2;
  498. X
  499. Xint total    = TOTAL;
  500. Xint objects  = OBJECTS;
  501. Xint stars    = STARS;
  502. Xint aspects  = 5;
  503. Xint universe = FALSE;
  504. Xint siderial = FALSE;
  505. Xint right    = FALSE;
  506. Xint centerplanet   = 1;
  507. Xint todisplay      = 0;
  508. Xint housesystem    = DEFAULT_SYSTEM;
  509. Xint cusp           = FALSE;
  510. Xint uranian        = FALSE;
  511. Xint multiplyfactor = 1;
  512. Xint onasc     = 0;
  513. Xint flip      = FALSE;
  514. Xint decan     = FALSE;
  515. Xint geodetic  = FALSE;
  516. Xint graphstep = 5;
  517. Xint progress  = FALSE;
  518. Xint autom     = FALSE;
  519. Xint relation  = FALSE;
  520. Xint operation = 0;
  521. Xdouble progday = 365.25;
  522. Xdouble defzone = DEFAULT_ZONE;
  523. Xdouble deflong = DEFAULT_LONG;
  524. Xdouble deflat  = DEFAULT_LAT;
  525. Xdouble modulus = DEGREES;
  526. X
  527. Xdouble SD = 0.0, Mon, Day, Yea, Tim, Zon, Lon, Lat, Mon2, Yea2, Delta = 0.0,
  528. X  M = 11.0, D = 19.0, Y = 1971.0, F = 11.01, X = 8.0, L5 = 122.20, LA = 47.36,
  529. X  T, JD, Jdp;
  530. X
  531. Xdouble planet[TOTAL+1], planetalt[TOTAL+1], house[SIGNS+1], ret[TOTAL+1],
  532. X  spacex[BASE+1], spacey[BASE+1], spacez[BASE+1];
  533. Xint inhouse[TOTAL+1], grid[TOTAL+1][TOTAL+1],
  534. X  gridname[TOTAL+1][TOTAL+1], wheel[SIGNS][WHEELROWS],
  535. X  inhouse1[TOTAL+1], inhouse2[TOTAL+1], starname[STARS+1];
  536. Xint ignore[TOTAL+1]
  537. X  = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,                /* Planets  */
  538. X#ifdef ASTEROIDS
  539. X     0, 0, 0, 0, 0, 0, 0, 0, 0, 0,                   /* Minors   */
  540. X#else
  541. X     1, 1, 1, 1, 1, 0, 1, 0, 0, 1,
  542. X#endif
  543. X     0, 0, 0, 0,                                     /* Cusps    */
  544. X     0, 0, 0, 0, 0, 0, 0, 0,                         /* Uranians */
  545. X     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* Stars    */
  546. X     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  547. X
  548. X
  549. X/*
  550. X*******************************************************************************
  551. X** Table data
  552. X*******************************************************************************
  553. X*/
  554. X
  555. Xchar *signname[]
  556. X  = {"???", "Aries", "Taurus", "Gemini", "Cancer",
  557. X       "Leo", "Virgo", "Libra", "Scorpio",
  558. X       "Sagittarius", "Capricorn", "Aquarius", "Pisces"};
  559. X
  560. Xchar signabbrev[][3]
  561. X  = {"??",
  562. X       "Ar", "Ta", "Ge", "Cn", "Le", "Vi", "Li", "Sc", "Sg", "Cp", "Aq", "Pi"};
  563. X
  564. Xchar objectname[][12]
  565. X  = {"Earth", "Sun", "Moon", "Mercury", "Venus", "Mars",      /* Planets   */
  566. X       "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto",
  567. X       "Chiron", "Ceres", "Pallas", "Juno", "Vesta",          /* Asteroids */
  568. X       "Node", "Fortune", "Midheaven", "Ascendant", "Vertex", /* Others    */
  569. X       "11th Cusp", "12th Cusp", "2nd Cusp", "3rd Cusp",      /* Cusps     */
  570. X       "Cupido", "Hades", "Zeus", "Kronos",                   /* Uranians  */
  571. X       "Apollo", "Admetos", "Vulkanus", "Poseidon",
  572. X
  573. X       "Achernar", "Polaris", "Zeta Retic.", "Pleiades",      /* Stars     */
  574. X       "Aldebaran", "Capella", "Rigel", "Bellatrix", "Alnath",
  575. X       "Orion", "Betelgeuse", "Menkalinan", "Murzim",
  576. X       "Canopus", "Alhena", "Sirius", "Adara", "Wezen",
  577. X       "Castor", "Procyon", "Pollux", "Suhail", "Avior",
  578. X       "Miaplacidus", "Alphard", "Regulus", "Dubhe", "Acrux",
  579. X       "Gacrux", "Becrux", "Alioth", "Spica", "Alkaid",
  580. X       "Agena", "Arcturus", "Kentaurus", "Antares", "Shaula",
  581. X       "Sargas", "Australis", "Vega", "Altair", "Peacock",
  582. X       "Deneb", "Alnair", "Fomalhaut"};
  583. X
  584. Xchar *systemname[]
  585. X  = {"Placidus", "Koch", "Equal", "Campanus", "Meridian",
  586. X       "Regiomontanus", "Porphyry", "Morinus", "Topocentric", "Null"};
  587. X
  588. Xchar *aspectname[]
  589. X  = {"???", "Conjunct", "Opposite", "Square", "Trine", "Sextile",
  590. X       "Inconjunct", "Semisextile", "Semisquare", "Sesquiquadrate",
  591. X       "Quintile", "Biquintile",
  592. X       "Semiquintile", "Septile", "Novile",
  593. X       "Binovile", "Biseptile", "Triseptile", "Quatronovile"};
  594. X
  595. Xchar *aspectglyph[]
  596. X = {"???", "Circle with extending line", "Two circles joined by line",
  597. X      "Quadrilateral", "Triangle", "Six pointed asterisk", "'K' rotated right",
  598. X      "'K' rotated left", "Acute angle", "Square with extending lines",
  599. X      "Letter 'Q'", "'+' over '-'", "'-' over '+'", "Number '7'", "Number '9'",
  600. X      "'9' under Roman 'II'", "'7' under Roman 'II'", "'7' under Roman 'III'",
  601. X      "'9' under Roman 'IV'"};
  602. X
  603. Xchar aspectabbrev[][4]
  604. X  = {"   ", "Con", "Opp", "Squ", "Tri", "Sex",
  605. X       "Inc", "SSx", "SSq", "Ses", "Qui", "BQn",
  606. X       "SQn", "Sep", "Nov", "BNv", "BSp", "TSp", "QNv"};
  607. X
  608. Xdouble aspectangle[ASPECTS+1]
  609. X  = {0, 0.0, 180.0, 90.0, 120.0, 60.0, 150.0, 30.0, 45.0, 135.0, 72.0, 144.0,
  610. X       36.0, DEGREES/7.0, 40.0, 80.0, 720.0/7.0, 1080.0/7.0, 160.0};
  611. X
  612. Xdouble aspectorb[ASPECTS+1]
  613. X  = {0, 7.0, 7.0, 7.0, 7.0, 6.0, 3.0, 3.0, 3.0, 3.0, 2.0, 2.0,
  614. X       1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
  615. X
  616. Xint ruler1[OBJECTS+1]
  617. X  = {0, 5, 4,  3,  7,  1,  9, 10, 11, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  618. Xint ruler2[OBJECTS+1]
  619. X  = {0, 0, 0,  6,  2,  8, 12, 11,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  620. Xint exalt[OBJECTS+1]
  621. X  = {0, 1, 2, 11, 12, 10,  4,  7,  8,  9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  622. X
  623. Xchar *element[] = {"Fire", "Earth", "Air", "Water"};
  624. Xchar *mode[] = {"Cardinal", "Fixed", "Mutuable"};
  625. X
  626. Xchar post[][3]
  627. X  = {"",
  628. X       "st", "nd", "rd", "th", "th", "th", "th", "th", "th", "th", "th", "th"};
  629. X
  630. Xchar *monthname[]
  631. X  = {"", "January", "February", "March", "April", "May", "June", "July",
  632. X       "August", "September", "October", "November", "December"};
  633. X
  634. X#ifdef X11
  635. Xchar *signdraw[] = {"",
  636. X  "ND4HU2HLGDFBR6EUHLGD2G", "BL3D2F2R2E2U2H2NE2L2NH2G2",
  637. X  "BLU3LHBR7GLNL3D6NL3RFBL7ERU3", "BGNDHLGDFRNEFR2EREBU3NHDGLHUENRHL2GLG",
  638. X  "BF4H2UEU2H2L2G2D2FDGH", "BF4HNGNHEU5GHND5HGND6HGND6H",
  639. X  "BGNL3HUER2FDGR3BD2L8", "BH4FND6EFND6EFD6FREU",
  640. X  "BG4E3NH2NF2E5NL2D2", "BH3NLNUD3FND2EU2ENF2UFERFDGLF2D2G",
  641. X  "BG4EUEDFDEUEDFDEUEBU5GDGUHUGDGUHUGDG", "NL4NR4BH4F2D4G2BR8H2U4E2"};
  642. X
  643. Xchar *objectdraw[] = {"ND4NL4NR4U4LGLDGD2FDRFR2ERUEU2HULHL", /* Earth */
  644. X  "U0BH3DGD2FDRFR2ERUEU2HULHL2GL", /* Sun */
  645. X  "BG3E2U2H2ER2FRDFD2GDLGL2H", /* Moon */
  646. X  "BD4UNL2NR2U2REU2HNEL2NHGD2FR", /* Mercury */
  647. X  "LHU2ER2FD2GLD2NL2NR2D2", /* Venus */
  648. X  "HLG2DF2RE2UHE4ND2L2", /* Mars */
  649. X  "BH3RFDGDGDR5NDNR2U6E", /* Jupiter */
  650. X  "BH3R2NUNR2D3ND3RERFDGDF", /* Saturn */
  651. X  "BD4NEHURBFULU3NUNR2L2NU2DGBU5NFBR6GD3F", /* Uranus */
  652. X  "BD4U2NL2NR2U5NUNRLBL2NUNLDF2R2E2UNRU", /* Neptune */
  653. X  "D2NL2NR2D2BU8GFEHBL3D2F2R2E2U2", /* Pluto */
  654. X  "BG2LDFEULU3NURFRFBU5GLGLU2", /* Chiron */
  655. X  "BD4UNL3NR3U2RE2UH2L2G", /* Ceres */
  656. X  "BD4UNL3NR3UE2HUHNUGDGF2", /* Pallas Athena */
  657. X  "BD4UNL2NR2U4NL4NR4NE3NF3NG3NH3U3", /* Juno */
  658. X  "BU4DBG3NLFDF2E2UERBH2GDGHUH", /* Vesta */
  659. X  "BG2LGFEU2HU2E2R2F2D2GD2FEHL", /* North Node */
  660. X  "NE2NF2NG2H2GD2F2R2E2U2H2L2G", /* Part of Fortune */
  661. X  "BG4U8F4E4D8", /* Midheaven */
  662. X  "NR4L4ND4UE3R2F3D5", /* Ascendant */
  663. X  "U2NHNEBD4NGNFU2L2NHNGR4NEF" /* Vertex */};
  664. X
  665. Xchar *housedraw[] = {"",
  666. X  "BD2NLNRU4L", "BHBUR2D2L2D2R2", "BHBUR2D2NL2D2L2",
  667. X  "BHBUD2R2NU2D2", "BEBUL2D2R2D2L2", "NLRD2L2U4R2",
  668. X  "BHBUR2DG2D", "NRLU2R2D4L2U2", "NRLU2R2D4L2",
  669. X  "BH2NLD4NLRBR2U4R2D4L2", "BH2NLD4NLRBR2RNRU4L", "BH2NLD4NLRBR2NR2U2R2U2L2"};
  670. X
  671. Xchar *aspectdraw[] = {"",
  672. X  "HLG2DF2RE2UHE4", "BGL2GDFREU2E2U2ERFDGL2", "BH4R8D8L8U8",
  673. X  "BU4GDGDGDGDR8UHUHUHUH", "BLNH3NG3RNU4ND4RNE3F3",
  674. X  "BG4EUEUEUEUNL4NR4BDFDFDFDF", "BH4FDFDFDFDNL4NR4BUEUEUEUE", "BE4G8R8",
  675. X  "BD2L3U6R6D6L3D2R2", "F4BU3U2HULHL2GLDGD2FDRFR2E3", "BD2U3NR3NU3L3BD5R6",
  676. X  "BU2D3NR3ND3L3BU5R6", "BH3R6G6", "BR3L5HUER4FD4GL4H",
  677. X  "BF2UHL2GFR3DGL3BE6LNLU2NRLBL4LNLD2NLR", "BL2R4G4BE6LNLU2NRLBL4LNLD2NLR",
  678. X  "BL2R4G4BE6L7NLU2NLR3ND2R3ND2R", "BF2UHL2GFR3DGL3BU6LNLU2NLRBR2F2E2"};
  679. X#endif
  680. X
  681. Xdouble starbright[] = {0,
  682. X  0.46,2.02,5.24,5.09,0.85,0.08,0.12,1.64,1.65,1.70,0.50,1.90,1.98,-0.72,1.93,
  683. X  -1.46,1.50,1.84,1.59,0.38,1.14,1.78,1.86,1.68,1.98,1.35,1.79,1.58,1.63,1.25,
  684. X  1.77,0.98,1.86,0.61,-0.04,-0.01,0.96,1.63,1.87,1.85,0.03,0.77,1.94,1.25,1.74,
  685. X  1.16};
  686. X
  687. Xdouble stardata[] = {
  688. X 1,37,42.9,-57,14,12,   2,31,50.5, 89,15,51,   3,17,46.1,-62,34,32,
  689. X 3,49,11.1, 24, 8,12,   4,35,55.2, 16,30,33,   5,16,41.3, 45,59,53,
  690. X 5,14,32.2, -8,12, 6,   5,25, 7.8,  6,20,59,   5,26,17.5, 28,36,27,
  691. X 5,36,12.7, -1,12, 7,   5,55,10.3,  7,24,25,   5,59,31.7, 44,56,51,
  692. X 6,22,41.9,-17,57,22,   6,23,57.2,-52,41,44,   6,37,42.7, 16,23,57,
  693. X 6,45, 8.9,-16,42,58,   6,58,37.5,-28,58,20,   7, 8,23.4,-26,23,35,
  694. X 7,34,35.9, 31,53,18,   7,39,18.1,  5,13,30,   7,45,18.9, 28, 1,34,
  695. X 8, 9,31.9,-47,20,12,   8,22,30.8,-59,30,34,   9,13,12.1,-69,43, 2,
  696. X 9,27,35.2, -8,39,31,  10, 8,22.3, 11,58,2,   11, 3,43.6, 61,45, 3,
  697. X12,26,35.9,-63, 5,56,  12,31, 9.9,-57, 6,47,  12,47,43.3,-59,41,19,
  698. X12,54, 1.7, 55,57,35,  13,25,11.5,-11, 9,41,  13,47,32.3, 49,18,48,
  699. X14, 3,49.4,-60,22,22,  14,15,39.6, 19,10,57,  14,39,36.2,-60,50, 7,
  700. X16,29,24.4,-26,25,55,  17,33,36.4,-37, 6,13,  17,37,19.0,-42,59,52,
  701. X18,24,10.3,-34,23, 5,  18,36,56.2, 38,47, 1,  19,50,46.9,  8,52, 6,
  702. X20,25,38.8,-56,44, 7,  20,41,25.8, 45,16,49,  22, 8,13.9,-46,57,40,
  703. X22,57,39.0,-29,37,20};
  704. X
  705. Xint errorcount[PLANETS+1] = {0, 0, 0, 0, 0, 0, 11, 5, 4, 4, 4};
  706. X
  707. Xdouble planetdata[] = {
  708. X358.4758,35999.0498,-.0002,.01675,-.4E-4,0,1,101.2208,1.7192,.00045,0,0,0,0,0,
  709. X0, /* Sun/Earth */
  710. X102.2794,149472.515,0,.205614,.2E-4,0,.3871,28.7538,.3703,.0001,47.1459,1.1852,
  711. X0.0002,7.009,.00186,0, /* Mercury */
  712. X212.6032,58517.8039,.0013,.00682,-.5E-4,0,.7233,54.3842,.5082,-.14E-2,75.7796,
  713. X0.8999,.4E-3,3.3936,.1E-2,0, /* Venus */
  714. X319.5294,19139.8585,.2E-3,.09331,.9E-4,0,1.5237,285.4318,1.0698,.1E-3,48.7864,
  715. X0.77099,0,1.8503,-.7E-3,0, /* Mars */
  716. X225.4928,3033.6879,0,.04838,-.2E-4,0,5.2029,273.393,1.3383,0,99.4198,1.0583,0,
  717. X1.3097,-.52E-2,0, /* Jupiter */
  718. X-.001,-.0005,.0045,.0051,581.7,-9.7,-.0005,2510.7,-12.5,-.0026,1313.7,-61.4,
  719. X0.0013,2370.79,-24.6,-.0013,3599.3,37.7,-.001,2574.7,31.4,-.00096,6708.2,
  720. X-114.5,-.0006,5499.4,-74.97,-.0013,1419,54.2,.0006,6339.3,-109,.0007,4824.5,
  721. X-50.9,.0020,-.0134,.0127,-.0023,676.2,.9,.00045,2361.4,174.9,.0015,1427.5,
  722. X-188.8,.0006,2110.1,153.6,.0014,3606.8,-57.7,-.0017,2540.2,121.7,-.00099,
  723. X6704.8,-22.3,-.0006,5480.2,24.5,.00096,1651.3,-118.3,.0006,6310.8,-4.8,.0007,
  724. X4826.6,36.2, /* Jupiter error */
  725. X174.2153,1223.50796,0,.05423,-.2E-3,0,9.5525,338.9117,-.3167,0,112.8261,.8259,
  726. X0,2.4908,-.0047,0, /* Saturn */
  727. X-.0009,.0037,0,.0134,1238.9,-16.4,-.00426,3040.9,-25.2,.0064,1835.3,36.1,
  728. X-.0153,610.8,-44.2,-.0015,2480.5,-69.4,-.0014,.0026,0,.0111,1242.2,78.3,-.0045,
  729. X3034.96,62.8,-.0066,1829.2,-51.5,-.0078,640.6,24.2,-.0016,2363.4,-141.4,.0006,
  730. X-.0002,0,-.0005,1251.1,43.7,.0005,622.8,13.7,.0003,1824.7,-71.1,.0001,2997.1,
  731. X78.2, /* Saturn error */
  732. X74.1757,427.2742,0,.04682,.00042,0,19.2215,95.6863,2.0508,0,73.5222,.5242,0,
  733. X0.7726,.1E-3,0, /* Uranus */
  734. X-.0021,-.0159,0,.0299,422.3,-17.7,-.0049,3035.1,-31.3,-.0038,945.3,60.1,-.0023,
  735. X1227,-4.99,.0134,-.02186,0,.0317,404.3,81.9,-.00495,3037.9,57.3,.004,993.5,
  736. X-54.4,-.0018,1249.4,79.2,-.0003,.0005,0,.0005,352.5,-54.99,.0001,3027.5,54.2,
  737. X-.0001,1150.3,-88, /* Uranus error */
  738. X30.13294,240.45516,0,.00913,-.00127,0,30.11375,284.1683,-21.6329,0,130.68415,
  739. X1.1005,0,1.7794,-.0098,0, /* Neptune */
  740. X0.1832,-.6718,.2726,-.1923,175.7,31.8,.0122,542.1,189.6,.0027,1219.4,178.1,
  741. X-.00496,3035.6,-31.3,-.1122,.166,-.0544,-.00496,3035.3,58.7,.0961,177.1,-68.8,
  742. X-.0073,630.9,51,-.0025,1236.6,78,.00196,-.0119,.0111,.0001,3049.3,44.2,-.0002,
  743. X893.9,48.5,.00007,1416.5,-25.2, /* Neptune error */
  744. X229.781,145.1781,0,.24797,.002898,0,39.539,113.5366,.2086,0,108.944,1.3739,0,
  745. X17.1514,-.0161,0, /* Pluto */
  746. X-.0426,.073,-.029,.0371,372,-331.3,-.0049,3049.6,-39.2,-.0108,566.2,318.3,
  747. X0.0003,1746.5,-238.3,-.0603,.5002,-.6126,.049,273.97,89.97,-.0049,3030.6,61.3,
  748. X0.0027,1075.3,-28.1,-.0007,1402.3,20.3,.0145,-.0928,.1195,.0117,302.6,-77.3,
  749. X0.00198,528.1,48.6,-.0002,1000.4,-46.1, /* Pluto error */
  750. X34.6127752,713.5756219,0,.382270369,-.004694073,0,13.66975144,337.407213,
  751. X2.163306646,0,208.1482658,1.247724355,0,6.911179715,.011236955,0, /* chiron */
  752. X108.2925,7820.36556,0,.0794314,0,0,2.7672273,71.0794444,0,0,80.23555556,
  753. X1.3960111,0,10.59694444,0,0, /* Ceres */
  754. X106.6641667,7806.531667,0,.2347096,0,0,2.7704955,310.166111,0,0,172.497222,
  755. X1.39601111,0,34.81416667,0,0, /* Pallas athena */
  756. X267.685,8256.081111,0,.2562318,0,0,2.6689897,245.3752778,0,0,170.137777,
  757. X1.396011111,.0003083333,13.01694444,0,0, /* Juno */
  758. X138.7733333,9924.931111,0,.0902807,0,0,2.360723,149.6386111,0,0,103.2197222,
  759. X1.396011111,.000308333,7.139444444,0,0, /* Vesta */
  760. X104.5959,138.5369,0,0,0,0,40.99837, 0,0,0,0,0,0,0,0,0, /* Cupido */
  761. X337.4517,101.2176,0,0,0,0,50.667443,0,0,0,0,0,0,0,0,0, /* Hades */
  762. X104.0904,80.4057, 0,0,0,0,59.214362,0,0,0,0,0,0,0,0,0, /* Zeus */
  763. X17.7346, 70.3863, 0,0,0,0,64.816896,0,0,0,0,0,0,0,0,0, /* Kronos */
  764. X138.0354,62.5,    0,0,0,0,70.361652,0,0,0,0,0,0,0,0,0, /* Apollo */
  765. X-8.678,  58.3468, 0,0,0,0,73.736476,0,0,0,0,0,0,0,0,0, /* Admetos */
  766. X55.9826, 54.2986, 0,0,0,0,77.445895,0,0,0,0,0,0,0,0,0, /* Vulkanus */
  767. X165.3595,48.6486, 0,0,0,0,83.493733,0,0,0,0,0,0,0,0,0  /* Poseidon */
  768. X};
  769. X
  770. X#ifdef X11
  771. Xchar *worlddata[] = {
  772. X"-031+70",
  773. X"LLRRHLLLLDULLGLLLDULGLLLGLRREDEGGLGGLGLGLLGDRLDRLFFRRERFDFRRREUEEHLUERERUERRF\
  774. XGLGLDDFRRRRREFRLGLLLLLGEFDLHGDDLGHLGLLHGLHURDLRRELLLRHUGLDFDLGLLFHGGLGLLLDLLLD\
  775. XRRFFDDGLLLLLLGDFGDDRRFRERREEUEREUEFRRERRFFFRFRDDLLLLRFRUREURULHLHHHEF",
  776. X"5EUROPE",
  777. X"+006+50", "RRERRRRUELLUHHLLREULLELLDGHDUFDEGRDRRLFDLLRGRRGGL", "5ENGLAND",
  778. X"+008+55", "GLFGRRREUULL", "5IRELAND",
  779. X"+023+64", "RRFRERRREHLLLLLGHLLRFLLRFL", "5ICELAND",
  780. X"-011+80", "DDURFRERLGRRLLFRRREEFRRRLHGELLLHRRFRRRRERLLLLLLLLLLLDHGULLL",
  781. X"5SVALBARD",
  782. X"-014+45",
  783. X"FRFRFDDFRDRRLLFRURFHHUERRRRRHUUEERRRRGRDERRLHLRRERRGGRFRFFGLLLLHLLLLGLLDLLLFG\
  784. XRFFRERFRERDDDGDGLLDFFEUDDFFDFFDDFFFDFDDDRRERRERRRUERRERURUEEHHLHUGGLLLUUGUHUHU\
  785. XRRFFRFRRRDRRFRRRRRRRF",
  786. X"5MIDDLE EAST",
  787. X"-009+41", "DDRUULEUGD", "5SARDINIA",
  788. X"-024+35", "RRLL", "5CRETE",
  789. X"-032+35", "RRLL", "5CYPRUS",
  790. X"-052+37", "LLHUURHUHUHERERRRDDLLLFFDDURFLLDFDDL", "0CASPAIN SEA",
  791. X"-060+44", "LLUEERDFLDL", "0ARAL SEA",
  792. X"-068+24",
  793. X"FRGFRREDDDDDFDFDDFDDFERUEUUUUEEEEEREURRREFDFRDDDDRREFDDFDDGDDRFDDFDFFRUHUUHHH\
  794. XULUEUUURDRFDFRDEEREUUUHHHUUEERRDDEURRERREREEEUEULLREUHUHLEERRHLGLULUREERDLDRER\
  795. XRFGRFDGRRREUHHUREUE",
  796. X"6ASIA S",
  797. X"-140+36",
  798. X"DEUUEUHURREREEGLLHHDDGLDRGDDGGLGLLLGGLDLRDFEUHRRGEERDLLRGLRERRERRE",
  799. X"6JAPAN",
  800. X"-121+25", "GDFUEUL", "6TAIWAN",
  801. X"-080+10", "DDDDREUHH", "6SRI LANKA",
  802. X"-121+18", "LDDDRDDRHRRFFDDDLLEHDULRHDFDDGERDDREUUULUUHHLHEUUL",
  803. X"2PHILIPPINES",
  804. X"-131+43",
  805. X"EFREEREEEUUUEUHLLUDLULEERERERRRRRRERRFLRRRRLUERERRRDRERURRGDLGLGLGLGGDDFDFEUR\
  806. XRUERUURULEEREDERRFRERERRRERRHLHLRRRREURDRRFRFRUURRHLLLDHHLLHLLHLLLLLLLDLLHRLLL\
  807. XLLLLGHULLLLLLLLLLULLLGL",
  808. X"6SIBERIA",
  809. X"-145+71",
  810. X"RELLRHLLLLGDHGHLLLLGLLHUHLLLLLDLLLLHLLLLLDULUDLGLLLLRRERERRRELHLLLLLLLELLLLGD\
  811. XLLLLLUDLLLLLGLLLDLLLLLLLDFRDDHELLLLLLDRRLLHUDLGFGRRRRFRLHLLDGLGLLHRRREUHUUULLG\
  812. XGLDRFGHLLLHLLLLRFGHLGLLLULGLLLGLLHRHLDDDLLLLDLLLFLLHUHLRRFRRRREHLLHLLLHLL",
  813. X"6RUSSIA",
  814. X"-143+54", "GDDDDDDDEDUUURUUHUU", "6SAKHALIN",
  815. X"-180+72", "GRRRRULLL", "6WRANGEL I.",
  816. X"-137+76", "DRRRRRRRELLLLLLLL", "6SIBERIAN I.",
  817. X"-091+80", "FERDRRRRRRULLLLLRRULLLLGL", "6SEVERNAYA",
  818. X"-101+79", "GRRRRELLLL", "6ZEMLYA",
  819. X"-068+77", "LLGLLLLLLGLLGGLGLRFRRRRLHERERERRRERRRREL", "6NOVAYA",
  820. X"+123+49",
  821. X"FGULLFDDDGFDDDFFDFRFRFDFFFDLFFRDFFEHHHHUHHUFRDFFFRDFFFDFGFRFRFRRFRRRRFFRRFRFF\
  822. XDRFFRFEUUGLHHUUEUHLLLLLEUUEULLLGDLLGLHHUHUUUEHEERERRFRRHRREFRRFDFDFEUUHUUUEERE\
  823. XRUUUHFDEUHFEURRRELUERRE",
  824. X"4NORTH AMERICA S",
  825. X"+113+42", "FH", "0SALT LAKE",
  826. X"+156+20", "DRULHLHL", "4HAWAII",
  827. X"+085+22", "RERFRRFRGRRRRHLHLHLLLLLG", "4CUBA",
  828. X"+070+18", "RRHHLLLFLLLFRRRRRR", "4HAITI",
  829. X"+078+18", "RRHLLF", "4JAMAICA",
  830. X"+066+18", "ELLDR", "4PUERTO RICO",
  831. X"+078+24", "UD", "4NASSAU",
  832. X"+067+45",
  833. X"REFLGDERERREHDLLLHUELLLGLGLREEERRRRRRREERRGGDGRRRFEFUUHLLLEUUHHGLRELLHHUHHHDG\
  834. XLGHHULLHLLLLLDFGFDDGLLFDDGHHUULLLLHLLHLLLUHUUEREEREERRRREUUHLLLDDGHULLLHLUHLGD\
  835. XRFGGULLLLLLLLLHLLGFLHLLLLLRHLLLLLHLLLLLLHGLLLLGUGLLLHLL",
  836. X"4CANADA",
  837. X"+088+49",
  838. X"LGLGRRRRRRRFLLLGRGDDREUURUFRGRFGFERERREEREERLGGLGLLLGRLLGLEUERHLLLHULHL",
  839. X"0GREAT LAKES",
  840. X"+117+61", "REHRFRRERGLGLLLL", "0SLAVE LAKE",
  841. X"+125+66", "RRERRRGREDLFHGLLLERLLLL", "0BEAR LAKE",
  842. X"+097+50", "UULHURFDFG", "0LAKE WINNIPEG",
  843. X"+090+72",
  844. X"FRRLLFRRRRRRRRRRFRRGLLGRREEFRFLGLFLLLLFRERFRFRRFRRHLHFRRRUHLHRRFRURELLHLLLHRR\
  845. XHLHLHGHLHLLGLLEHFRRRHLLLLLLGLDFHLUELLGG",
  846. X"4BAFFIN I.",
  847. X"+125+72",
  848. X"RFRREERRRLLGFFRRRRRLLLLLFRRRRRRRREFRRRRHRRLHLHHLRRULGLFLHLDLLULLLLHLLLLLLLDG",
  849. X"4VICTORIA I.",
  850. X"+141+70",
  851. X"LLLLLLLLHGLHLLLHGLLGLLGLLDRRFRRDLLLULGLLFRRRRRRDLGLLGFDRRRDRRRRRGGGLLGLLGGLLR\
  852. XRERERRRERREERRELEERRRLLGDRERRURRFRRRRRFRRFUDRUDDHFDURDURLURDDLFRULURDHFFRGFEGR\
  853. XFFRFRFLHLHLFFRFE",
  854. X"4ALASKA",
  855. X"+045+60",
  856. X"REUEREUERRRRERERRRERRRRERLLLLLLHRRRGERHFRRRRHLUDLLHLRERFRERLEUHRRHLEERLLURRRR\
  857. XRRRRELLLLLLLLLLGLLLRERHGLRELLLLLLLELLLLLLLLLLGLLLLLLGLLLLLLGLULLLLLLLFRLLLLLGL\
  858. XRRRGLLLLLLLGRRRRRRRGLLLLRRFRRRRRRRRRRFDFDLFREFRDLLLDERRFGLLGFFDRFFFRRRF",
  859. X"4GREENLAND",
  860. X"+080+10",
  861. X"DRFDFDDGGGDDGRDGDDFFDFDFFDFFRFFFDDDDDDGDDDDGDDDDGDGFGDDDEUDDDGUDDLDRGDDDFDFRF\
  862. XRRFERRLHLUHUURUEELHEREURULURREURREREUHUUDFRREEEEEUEUUEERERRREUEUEUUUUUEEEEUUUH\
  863. XLHLHLLLLHLHLGEHLGEUHUUHLHLLLHHLHULEDLLELLGHLLHLGDDHUELLGLGDGHHL",
  864. X"3SOUTH AMERICA",
  865. X"+060-51", "LDRRELL", "3FALKLAND ISLANDS",
  866. X"+092+00", "FUL", "3GALAPAGOS I.",
  867. X"-032+32",
  868. X"LLGLHLLLLHLGDGHLLHHLLHLEUULLLLLLLLLGLGLLLLHDGLGDGDGGLDGGGDGDFDDDDGDDFFFFDFRFF\
  869. XRRRRRRRRERERRFFRRFFDDDGDFFFDFDDDFDGDGDDDFDFDFDDDFDFDFDDFFERRRRREEEEEEEUUEREUUH\
  870. XUEEEREEUUUUHUUUHUEUEEEEEREEUEUEEUUULLLLGLLHUHHLHUHHUUHHUUHUHHUU",
  871. X"1AFRICA",
  872. X"-049-12", "DGGGLGDDDDGDDFFREUEUEUUUEUUUUH", "1MADAGASCAR",
  873. X"-032+00", "DDDREUELLL", "0LAKE VICTORIA",
  874. X"-014+14", "LRFLU", "0LAKE CHAD",
  875. X"-124-16",
  876. X"LGDGGLGLLGLDDDGFDDFDFDGFRRRERRRRURERRRRRRRFFFEEDDRFDFRFREFRERRUUEUEEUUUUUUUHH\
  877. XHHHHHUUHHHUULDDDDGDGHLHLHEUELLLHLFLLULDRGDDLLHLGG",
  878. X"2AUSTRALIA",
  879. X"-173-35", "FFDGFDREURULHHHL", "2NEW ZEALAND N",
  880. X"-174-41", "LLDGLGLGGRFREEUREEU", "2NEW ZEALAND S",
  881. X"-145-41", "DFRRUUUDLLL", "2TASMANIA",
  882. X"-178-17", "GRRURUGDH", "2FIJI",
  883. X"-130+00", "FRFRLGFEFRFRFDGRRFRRUERFFFRRRLHHHHRHLHHLHLLHGGLHUHLGH",
  884. X"2NEW GUINEA",
  885. X"-115-04", "RUUEEURHUUEHHGGGGLLDDHLDDFDDRRDERF", "2BORNEO",
  886. X"-095+06", "DFFFFFFDFFFFRUUUHFRHLHLUHHHHHLLH", "2SUMATRA",
  887. X"-106-06", "GRFRRRRRRFRRHLHLLLLLHL", "2JAVA",
  888. X"-120+00", "DGDDRDFHUEDFRHUHREFHLGHURRRRELLLLG", "2CELEBES",
  889. X"+000-70",
  890. X"ULDLLLLLLLLGLLGLLLGLLGLLLLGLGLLGLLLLGLLLLLHLGLLLLLHLLLLLHLLLLHLLUERLEUUUUUUEE\
  891. XRRRULLGLLLLGLGGLLLDRUDRDLGHLLGLLFGRRFLLLLLLLDHLLLLHLLLLLGLLLLHLLLLLLLGRFDLLLUL\
  892. XLLGHLLLLLLLLLLHGHLLGLLLLLLLGLLLLLLLLLLLGLLLGLLLLLLLLGLLLLLLLLLLLLLLLLLLLLL",
  893. X"7ANTARCTICA W",
  894. X"+180-78",
  895. X"LLLLLLLHLLGHLLGHLUEERRERREHLLLLHLLLLLLHLLLLLLLLLLLHLHLLLLLHLLULDLLLLLDLLHLLLL\
  896. XGHFLLLLLHLLLLLLGLHLLHLGLLLLHLGLLGLLLULLLGLLHDFLLLGLGLLLELLLLHLLLLLLLLLLHLLLHLL\
  897. XLLGGHGHGLLLGLDLLLLHLLGHGLLLLLLLLLLLLLLHLGLLLLLLLLLLLLLL",
  898. X"7ANTARCTICA E",
  899. X"E", "", ""};
  900. X#endif
  901. X
  902. X
  903. X/*
  904. X*******************************************************************************
  905. X** General and numeric routines
  906. X*******************************************************************************
  907. X*/
  908. X
  909. Xvoid swapint(i1, i2)
  910. Xint *i1, *i2;
  911. X{
  912. X  int temp;
  913. X  temp = *i1; *i1 = *i2; *i2 = temp;
  914. X}
  915. X
  916. Xvoid swapdoub(f1, f2)
  917. Xdouble *f1, *f2;
  918. X{
  919. X  double temp;
  920. X  temp = *f1; *f1 = *f2; *f2 = temp;
  921. X}
  922. X
  923. Xint stringlen(line)
  924. Xchar *line;
  925. X{
  926. X  int i;
  927. X  for (i = 0; line[i] != 0; i++)
  928. X    ;
  929. X  return i;
  930. X}
  931. X
  932. Xdouble dabs(A)
  933. Xdouble A;
  934. X{
  935. X  return A < 0.0 ? -A : A;
  936. X}
  937. X
  938. Xdouble sgn(A)
  939. Xdouble A;
  940. X{
  941. X  return A < 0.0 ? -1.0 : (A > 0.0 ? 1.0 : 0.0);
  942. X}
  943. X
  944. Xdouble dectodeg(A)
  945. Xdouble A;
  946. X{
  947. X  return sgn(A)*(floor(dabs(A))+(dabs(A)-floor(dabs(A)))*100.0/60.0);
  948. X}
  949. X
  950. Xdouble mod(A)
  951. Xdouble A;
  952. X{
  953. X  return ((A)-(floor((A)/modulus)*modulus));
  954. X}
  955. X
  956. Xint mod12(A)
  957. Xint A;
  958. X{
  959. X  return A > SIGNS ? A-SIGNS : (A < 1 ? A+SIGNS : A);
  960. X}
  961. X
  962. Xdouble mindistance(deg1, deg2)
  963. Xdouble deg1, deg2;
  964. X{
  965. X  double i;
  966. X  i = dabs(deg1-deg2);
  967. X  return i < 180 ? i : DEGREES - i;
  968. X}
  969. X
  970. Xdouble midpoint(deg1, deg2)
  971. Xdouble deg1, deg2;
  972. X{
  973. X  double mid;
  974. X  mid = (deg1+deg2)/2.0;
  975. X  return mindistance(deg1, mid) < 90 ? mid : mod(mid+180);
  976. X}
  977. X
  978. Xchar dignify(body, sign)
  979. Xint body, sign;
  980. X{
  981. X  if (body > 10)
  982. X    return ' ';
  983. X  if (ruler1[body] == sign || ruler2[body] == sign)
  984. X    return 'R';
  985. X  if (ruler1[body] == mod12(sign+6) || ruler2[body] == mod12(sign+6))
  986. X    return 'F';
  987. X  if (exalt[body] == sign)
  988. X    return 'e';
  989. X  if (exalt[body] == mod12(sign+6))
  990. X    return 'd';
  991. X  return '-';
  992. X}
  993. X
  994. Xint dayinmonth(month, year)
  995. Xint month, year;
  996. X{
  997. X  return (month == 9 || month == 4 || month == 6 || month == 11 ? 30 :
  998. X      (month != 2 ? 31 :
  999. X       (year/4*4==year && (year/100*100!=year || year/400*400==year) ?
  1000. X        29 : 28)));
  1001. X}
  1002. X
  1003. Xdouble orb(body1, body2, aspect)
  1004. Xint body1, body2, aspect;
  1005. X{
  1006. X  static int max = 1;
  1007. X  double orb;
  1008. X  if (aspect == 0)
  1009. X    return (max = 1-max);
  1010. X  if (max && (body1 == 16 || body1 == 17 || body1 == 20 || body1 > BASE ||
  1011. X          body2 == 16 || body2 == 17 || body2 == 20 || body2 > BASE))
  1012. X    orb = 2.0;
  1013. X  else
  1014. X    orb = aspectorb[aspect];
  1015. X  if (body1 <= 2) orb += 1.0;
  1016. X  if (body2 <= 2) orb += 1.0;
  1017. X  return orb;
  1018. X}
  1019. X
  1020. X
  1021. X/*
  1022. X*******************************************************************************
  1023. X** IO routines
  1024. X*******************************************************************************
  1025. X*/
  1026. X
  1027. Xvoid toofew(option)
  1028. Xchar *option;
  1029. X{
  1030. X  fprintf(stderr, "Too few options to switch -%s\n", option);
  1031. X  exit(1);
  1032. X}
  1033. X
  1034. Xchar *stringlocation(Lon, Lat, norm)
  1035. Xdouble Lon, Lat, norm;
  1036. X{
  1037. X  static char string[14];
  1038. X  int i, j;
  1039. X  i = (int) ((dabs(Lon)-floor(dabs(Lon)))*norm+0.1);
  1040. X  j = (int) ((dabs(Lat)-floor(dabs(Lat)))*norm+0.1);
  1041. X  sprintf(string, "%3.0f'%d%d%c %2.0f'%d%d%c",
  1042. X      floor(dabs(Lon)), i/10, i%10, Lon < 0.0 ? 'E' : 'W',
  1043. X      floor(dabs(Lat)), j/10, j%10, Lat < 0.0 ? 'S' : 'N');
  1044. X  return string;
  1045. X}
  1046. X
  1047. Xdouble readstardata(reset)
  1048. Xint reset;
  1049. X{
  1050. X  static int datapointer = 0;
  1051. X  if (!reset)
  1052. X    return stardata[datapointer++];
  1053. X  return (double) (datapointer = 0);
  1054. X}
  1055. X
  1056. Xdouble readplanetdata(reset)
  1057. Xint reset;
  1058. X{
  1059. X  static int datapointer = 0;
  1060. X  if (!reset)
  1061. X    return planetdata[datapointer++];
  1062. X  return (double) (datapointer = 0);
  1063. X}
  1064. X
  1065. X#ifdef X11
  1066. Xint readworlddata(nam, loc, lin)
  1067. Xchar **nam, **loc, **lin;
  1068. X{
  1069. X  static int datapointer = 0;
  1070. X  *loc = worlddata[datapointer++];
  1071. X  *lin = worlddata[datapointer++];
  1072. X  *nam = worlddata[datapointer++];
  1073. X  if (*loc[0] != 'E')
  1074. X    return 1;
  1075. X  return (datapointer = 0);
  1076. X}
  1077. X#endif
  1078. X
  1079. X/*void printsecond(deg)
  1080. Xdouble deg;
  1081. X{
  1082. X  int sign, d, m, s;
  1083. X  deg = mod(deg + 1.0/60.0/60.0/2.0);
  1084. X  sign = (int) (deg / 30.0);
  1085. X  d = (int) deg - sign*30;
  1086. X  m = (int) ((deg - floor(deg))*60.0);
  1087. X  s = (int) (((deg - floor(deg))*60 - (double) m)*60.0);
  1088. X  printf("%s%d%c%c%c%s%d'%s%d\"",
  1089. X     d < 10 ? "0" : "", d, SIGNAM(sign + 1),
  1090. X     m < 10 ? "0" : "", m, s < 10 ? "0" : "", s);
  1091. X}
  1092. X
  1093. Xvoid printtenth(deg)
  1094. Xdouble deg;
  1095. X{
  1096. X  int sign, d, m;
  1097. X  deg = mod(deg + 1.0/60.0/10.0/2.0);
  1098. X  sign = (int) (deg / 30.0);
  1099. X  d = (int) deg - sign*30;
  1100. X  m = (int) ((deg - floor(deg))*600.0);
  1101. X  printf("%s%d%c%c%c%s%.1f",
  1102. X     d < 10 ? "0" : "", d, SIGNAM(sign + 1),
  1103. X     m < 100 ? "0" : "", (double) m / 10.0);
  1104. X}*/
  1105. X
  1106. Xvoid printminute(deg)
  1107. Xdouble deg;
  1108. X{
  1109. X  int sign, d, m;
  1110. X  if (!right) {
  1111. X    deg = mod(deg + 1.0/60.0/2.0);
  1112. X    sign = (int) (deg / 30.0);
  1113. X    d = (int) deg - sign*30;
  1114. X    m = (int) ((deg - floor(deg))*60.0);
  1115. X    printf("%s%d%c%c%c%s%d",
  1116. X       d < 10 ? "0" : "", d, SIGNAM(sign + 1), m < 10 ? "0" : "", m);
  1117. X  } else {
  1118. X    deg = mod(deg + 1.0/4.0/2.0);
  1119. X    d = (int) (deg / 15.0);
  1120. X    m = (int) ((deg - (double)d*15.0)*60.0/24.0);
  1121. X    printf("%s%dh,%s%dm",
  1122. X       d < 10 ? "0" : "", d, m < 10 ? "0" : "", m);
  1123. X  }
  1124. X}
  1125. X
  1126. Xvoid printaltitude(deg)
  1127. Xdouble deg;
  1128. X{
  1129. X  int d, m;
  1130. X  while (deg > 90.0)
  1131. X    deg -= 180.0;
  1132. X  while (deg < -90.0)
  1133. X    deg += 180.0;
  1134. X  putchar(deg < 0.0 ? '-' : '+');
  1135. X  deg = dabs(deg) + 1.0/60.0/2.0;
  1136. X  d = (int) deg;
  1137. X  m = (int) ((deg - floor(deg))*60.0);
  1138. X  printf("%s%d %s%d'", d < 10 ? "0" : "", d, m < 10 ? "0" : "", m);
  1139. X}
  1140. X
  1141. Xdouble input(prompt, low, high)
  1142. Xchar prompt[];
  1143. Xdouble low, high;
  1144. X{
  1145. X  char line[80];
  1146. X  double x;
  1147. X  while (1) {
  1148. X    printf("%s > ", prompt);
  1149. X    if (gets(line) == (char *) NULL) {
  1150. X      printf("\nAstrolog terminated.\n");
  1151. X      exit(1);
  1152. X    }
  1153. X    sscanf(line, "%lf", &x);
  1154. X    if (x >= low && x <= high)
  1155. X      return x;
  1156. X    printf("Value out of range of from %.0f to %.0f.\n", low, high);
  1157. X  }
  1158. X}
  1159. X
  1160. Xvoid inputdata(filename)
  1161. Xchar *filename;
  1162. X{
  1163. X  char name[STRING], c;
  1164. X  int i;
  1165. X  double k, l, m;
  1166. X#ifdef TIME
  1167. X  struct tm curtime;
  1168. X  int curtimer;
  1169. X  if (filename[0] == 'n' && filename[1] == 'o' && filename[2] == 'w' &&
  1170. X      filename[3] == 0) {
  1171. X    autom = 1;
  1172. X    curtimer = (int) time((int *) 0);
  1173. X    curtime = *localtime(&curtimer);
  1174. X    M = (double) curtime.tm_mon + 1.0;
  1175. X    D = (double) curtime.tm_mday;
  1176. X    Y = (double) curtime.tm_year + 1900.0;
  1177. X    F = (double) curtime.tm_hour + (double) curtime.tm_min / 100.0 +
  1178. X      (double) curtime.tm_sec / 6000.0;
  1179. X    X = defzone; L5 = deflong; LA = deflat;
  1180. X    return;
  1181. X  }
  1182. X#endif
  1183. X  if (filename[0] == 't' && filename[1] == 't' && filename[2] == 'y' &&
  1184. X      filename[3] == 0) {
  1185. X    printf("** Astrolog version %s (cruiser1@milton.u.washington.edu) **\n",
  1186. X      VERSION);
  1187. X#ifdef SWITCHES
  1188. X    printf("   Invoke as 'astrolog -H' for brief list of command options.\n");
  1189. X#endif
  1190. X    M = input("Enter month of birth [MM]  ", 1.0, 12.0);
  1191. X    D = input("Enter date  of birth [DD]  ", 1.0, 31.0);
  1192. X    Y = input("Enter year  of birth [YYYY]", 0.0, 4000.0);
  1193. X    printf("Assuming a 24 hour clock below (0.00=midnight, 18.00=6pm, etc)\n");
  1194. X    printf("Subtract 1 from hour entered if Daylight Saving time then.\n");
  1195. X    F = input("Time of birth [HR.MIN - Add 12 for PM times]", -2.0, 24.0);
  1196. X    printf("Enter negative value below for time zones east of Greenwich.\n");
  1197. X    X = input("Time zone in hours off GMT [HR.MIN - 5=Eastern, 8=Pacific]",
  1198. X          -24.0, 24.0);
  1199. X    printf("Enter negative values below for eastern or southern locations.\n");
  1200. X    L5 = input("Longitude west of place: DEG.MIN", -180.0, 180.0);
  1201. X    LA = input("Latitude north of place: DEG.MIN", -90.0, 90.0);
  1202. X    printf("\n");
  1203. X    return;
  1204. X  }
  1205. X  autom = 1;
  1206. X  data = fopen(filename, "r");
  1207. X  if (data == NULL) {
  1208. X    sprintf(name, "%s%s", DEFAULT_DIR, filename);
  1209. X    data = fopen(name, "r");
  1210. X    if (data == NULL) {
  1211. X      fprintf(stderr, "File '%s' not found.\n", filename);
  1212. X      exit(1);
  1213. X    }
  1214. X  }
  1215. X  if ((c = getc(data)) != 'S') {
  1216. X    ungetc(c, data);
  1217. X    fscanf(data, "%lf%lf%lf%lf%lf%lf%lf", &M, &D, &Y, &F, &X, &L5, &LA);
  1218. X  } else {
  1219. X    M = -1.0;
  1220. X    for (i = 1; i <= objects; i++) {
  1221. X      fscanf(data, "%s%lf%lf%lf", name, &k, &l, &m);
  1222. X      planet[i] = (l-1.0)*30.0+k+m/60.0;
  1223. X      fscanf(data, "%s%lf%lf", name, &k, &l);
  1224. X      planetalt[i] = k+l/60.0;
  1225. X      ret[i] = DTOR(name[1] == 'D' ? 1.0 : -1.0);
  1226. X    }
  1227. X    for (i = 1; i <= SIGNS/2; i++) {
  1228. X      fscanf(data, "%s%lf%lf%lf", name, &k, &l, &m);
  1229. X      house[i+6] = mod((house[i] = mod((l-1.0)*30.0+k+m/60.0))+180.0);
  1230. X    }
  1231. X  }
  1232. X  fclose(data);
  1233. X}
  1234. X
  1235. X/**/
  1236. END_OF_FILE
  1237. if test 27430 -ne `wc -c <'data.c'`; then
  1238.     echo shar: \"'data.c'\" unpacked with wrong size!
  1239. fi
  1240. # end of 'data.c'
  1241. fi
  1242. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  1243.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  1244. else
  1245. echo shar: Extracting \"'MANIFEST'\" \(1342 characters\)
  1246. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  1247. X   File Name        Archive #    Description
  1248. X-----------------------------------------------------------
  1249. X README                     1    Easy instructions on how to compile Astrolog.
  1250. X Makefile                   1    Unix Makefile to easily compile program.
  1251. X astrolog.dat               1    Data file with default program parameters.
  1252. X astrolog.h                 1    Compile time options and program definitions.
  1253. X data.c                     1    Table information and simple program functions.
  1254. X formulas.c                 2    Planetary and house position calculations.
  1255. X charts.c                   2    Routines to display charts on text screen.
  1256. X options.c                  2    Main display and search routines in program.
  1257. X xcharts.c                  3    Routines to draw graphic charts in X windows.
  1258. X graphics.c                 4    X window/bitmap primitives and window routines.
  1259. X driver.c                   3    Main program to connect all the other parts.
  1260. X Helpfile.p1                5    List of Astrolog features and how to use them.
  1261. X Helpfile.p2                6    Part 2 of the above file. (See the README).
  1262. X Update                     7    New features and bug fixes in version 2.10
  1263. X History.p1                 8    Features and bug fixes in previous versions.
  1264. X History.p2                 4    Part 2 of the above file. (See the README).
  1265. X MANIFEST                   1    This shipping list
  1266. END_OF_FILE
  1267. if test 1342 -ne `wc -c <'MANIFEST'`; then
  1268.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  1269. fi
  1270. # end of 'MANIFEST'
  1271. fi
  1272. echo shar: End of archive 1 \(of 8\).
  1273. cp /dev/null ark1isdone
  1274. MISSING=""
  1275. for I in 1 2 3 4 5 6 7 8 ; do
  1276.     if test ! -f ark${I}isdone ; then
  1277.     MISSING="${MISSING} ${I}"
  1278.     fi
  1279. done
  1280. if test "${MISSING}" = "" ; then
  1281.     echo You have unpacked all 8 archives.
  1282.     echo "See the README file for further instructions."
  1283.     rm -f ark[1-9]isdone
  1284. else
  1285.     echo You still need to unpack the following archives:
  1286.     echo "        " ${MISSING}
  1287. fi
  1288. ##  End of shell archive.
  1289. exit 0
  1290.  
  1291. exit 0 # Just in case...
  1292.