diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..ba64074 --- /dev/null +++ b/CHANGES @@ -0,0 +1,202 @@ +------------------------------ +11/26/97: limited alfa release +------------------------------ + + +------------- +2/13/98: v1.0 +------------- + +-Fixed a bug in planets rotation direction + +-Now use Yale Bright Stars catalog for stars positioning + +-3dfx Accelerated point management is OK starting with the Voodoo driver + included in Mesa 2.6 distribution + +-Runtime config options added + +-Makefile for Microsoft Visual C++ included + +-More accuracy + +-On screen info added + +-Orbits not in the same plane NOW + +-Minor speed improvements + +-Updated textures + + + +-------------- +2/15/98: v1.01 +-------------- + + +-Minor updates/bug fixes in Windows version + + + +-------------- +2/17/98: v1.02 +-------------- + + +-Linux "Core dumped bug" fixed + + + + +------------- +3/13/98: v1.1 +------------- + +-Code reorganization + +-Updated and new textures + +-New algorithm for planets positioning. You can view planets in a given date + (see README for accuracy details). Old Nbody algorithm is no longer supported + +-A few satellites added (Moon, Io, Callisto, Ganymede, Europa, Titan) + +-On screen help available + +-New camera handling routines (see README for details) + +-Minor updates/bug fixes + + + +------------ +5/2/98: v1.2 +------------ + +-Updated textures (Mercury, Ganymede, Callisto, Europa, Titan, Saturn Rings) + +-New satellites (Tethys, Dione, Rhea, Triton, Charon) + +-New Sun and Saturn Rings look (alpha blending) + +-Two new command line options, "-slices" and "-stacks" (see README for details) + +-Windows Screen Saver version (see scrsaver/README in windows distribution) + +-Fixed a bug in satellites positioning algorithm, orbits planes are OK now + +-More realistic planets' radii + +-Minor updates + + + +------------- +7/26/98: v1.3 +------------- + +-Fixed a bug in "no lighting" mode + +-Distant bodies labels + +-Enhanced textures + +-Mouse and Joystick support + +-Command line option for FULL SCREEN mode (-fullscreen) + +-New speed control method + +-Minor updates + + + +------------- +9/13/98: v1.4 +------------- + +-Fixed bugs in satellites positioning code + +-Two new camera modes (Body to Body and Orbiter, see README for details) + +-Great performance improvement, especially when running hardware accelerated. + (now SLICES and STACKS default to 20 instead of 12, but even with this + quality improvement program runs faster than ever) + +-Earth, Moon, Mars and Jupiter high resolution textures (see hires/README) + +-Real Time mode added + +-New fullscreen modes under windows 95 (see README for details) + +-Local time display in HUD + + +------------- +12/1/98: v1.5 +------------- + +-Smart texture handling (high-res maps on 3dfx cards, maps larger than texture + buffer and grayscale maps detection) + +-Textures update + +-Brighter Stars labels + +-On the fly star brightness control + +-FOV control + +-More performance improvement (about 20%) + +-Primitive framerate control (see command line options section in README) + +-Configuration file. This will let you use your own elements, define new + bodies, easily add rings and initialize parameters (demo mode, local time, + detail level, data directory, ...). + +-Current planet trail + +-Ability to save screenshots + +-A few accuracy bugs fixed + + + +------------- +2/26/99: v1.6 +------------- + +-New Earth, Saturn, Io and Europa texture maps + +-Atmosphere rendering ('a' toggles it on/off) + +-Flattening support (at last!, Jupiter and Saturn look more realistic) + +-Updated configuration file stuff (more readable and versatile, see ssystem.conf) + +-Asteroids (just a few and with a pseudo-random shape) + +-Deimos and Phobos (disabled by default, edit ssystem.conf to enable them) + +-Stars color based on their spectral type + +-Brighter stars are now textured objects + +-Improved "Linked" camera mode + +-New Sun texture (see sun section in ssystem.conf) + +-New planet positioning algorithms (based on VSOP87 theory, see bodies section + in ssystem.conf) + +-Improved trail support + +-Updated linux joystick support (you'll NEED 1.x joystick driver) + +-A nifty opening screen + +-Code clean up + +-The usual bunch of bug fixes diff --git a/HPUX.Install b/HPUX.Install new file mode 100644 index 0000000..cd4b95d --- /dev/null +++ b/HPUX.Install @@ -0,0 +1,55 @@ +Package name: ssystem +Version number: 1.6 +Original author: Raul Alonso +Original URL: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ +HP-UX URL: http://hpux.connect.org.uk/hppd/cgi-bin/search?package=&term=ssystem- +Dependencies: Mesa +Install tree: /opt/ssystem +Report bugs to: stephie@connect.org.uk +Tested on: HP 9000/780/C160 running HP-UX 11.00 +C compiler used: Version A.11.01.02 +Purpose: +OpenGL Solar System simulator. Visit the Sun, the nine planets and a few major +satellites with four camera modes. Catalogue based background stars are also +supported. +Date archived: Wed 19 Jan 2000 + +------------------------------------------------------------------------------- + +System: +====== + HP-UX shin B.10.20 A 9000/780 + +URL: +==== + ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ + + +HP Porting Changes: +=================== + + Configuration Files -> Makefile - added HP paths. + + Added HPUX alloca() rountine to the build (see: HPalloca.c). + + +Building: +========= + + Run "configure" || "xmkmf" to re-generate the Makefiles. + + Run "make" in the top level dir. + + Use "make -n install" to check the defaults, then "make install" + + +Installed: +========== + By + -- [steff@csc.liv.ac.uk] + On + -- + [Tue Jan 18 2000] + + HPUX Porting and Archive Centre, Connect, Liverpool University. + __/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/__/ diff --git a/HPalloca.c b/HPalloca.c new file mode 100644 index 0000000..daaed62 --- /dev/null +++ b/HPalloca.c @@ -0,0 +1,162 @@ +#ifdef emacs +#include "config.h" +#ifdef static +/* actually, only want this if static is defined as "" + -- this is for usg, in which emacs must undefine static + in order to make unexec workable + */ +#ifndef STACK_DIRECTION +you +lose +-- must know STACK_DIRECTION at compile-time +#endif /* STACK_DIRECTION undefined */ +#endif +#else +#define xmalloc malloc +#endif + +#if defined(X3J11) || defined(__STDC__) +typedef void *pointer; /* generic pointer type */ +#else +typedef char *pointer; /* generic pointer type */ +#endif + +#define NULL 0 /* null pointer constant */ + +extern void free(); +extern pointer xmalloc(); + +/* + Define STACK_DIRECTION if you know the direction of stack + growth for your system; otherwise it will be automatically + deduced at run-time. + + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown +*/ + +#ifndef STACK_DIRECTION +#define STACK_DIRECTION 0 /* direction unknown */ +#endif +#if STACK_DIRECTION != 0 + +#define STACK_DIR STACK_DIRECTION /* known at compile-time */ + +#else /* STACK_DIRECTION == 0; need run-time code */ + +static int stack_dir; /* 1 or -1 once known */ +#define STACK_DIR stack_dir + +static void +find_stack_direction (/* void */) +{ + static char *addr = NULL; /* address of first + `dummy', once known */ + auto char dummy; /* to get stack address */ + + if (addr == NULL) + { /* initial entry */ + addr = &dummy; + + find_stack_direction (); /* recurse once */ + } + else /* second entry */ + if (&dummy > addr) + stack_dir = 1; /* stack grew upward */ + else + stack_dir = -1; /* stack grew downward */ +} + +#endif /* STACK_DIRECTION == 0 */ + + + +/* + An "alloca header" is used to: + (a) chain together all alloca()ed blocks; + (b) keep track of stack depth. + + It is very important that sizeof(header) agree with malloc() + alignment chunk size. The following default should work okay. +*/ + +#ifndef ALIGN_SIZE +#define ALIGN_SIZE sizeof(double) +#endif + +typedef union hdr +{ + char align[ALIGN_SIZE]; /* to force sizeof(header) */ + struct + { + union hdr *next; /* for chaining headers */ + char *deep; /* for stack depth measure */ + } h; +} header; + +/* + alloca( size ) returns a pointer to at least `size' bytes of + storage which will be automatically reclaimed upon exit from + the procedure that called alloca(). Originally, this space + was supposed to be taken from the current stack frame of the + caller, but that method cannot be made to work for some + implementations of C, for example under Gould's UTX/32. +*/ + +static header *last_alloca_header = NULL; /* -> last alloca header */ + +pointer +alloca (size) /* returns pointer to storage */ + unsigned size; /* # bytes to allocate */ +{ + auto char probe; /* probes stack depth: */ + register char *depth = &probe; + +#if STACK_DIRECTION == 0 + if (STACK_DIR == 0) /* unknown growth direction */ + find_stack_direction (); +#endif + + /* Reclaim garbage, defined as all alloca()ed st +orage that + was allocated from deeper in the stack than c +urrently. */ + + { + register header *hp; /* traverses linked list */ + + for (hp = last_alloca_header; hp != NULL;) + if (STACK_DIR > 0 && hp->h.deep > depth + || STACK_DIR < 0 && hp->h.deep < depth) + { + register header *np = hp->h.next; + + free ((pointer) hp); /* collect garbage */ + + hp = np; /* -> next header */ + } + else + break; /* rest are not deeper */ + + last_alloca_header = hp; /* -> last valid storage */ + } + + if (size == 0) + return NULL; /* no allocation required */ + + /* Allocate combined header + user data storage. */ + { + register pointer new = xmalloc (sizeof (header) + size); + /* address of header */ + + ((header *)new)->h.next = last_alloca_header; + ((header *)new)->h.deep = depth; + + last_alloca_header = (header *)new; + + /* User storage begins just after header. */ + + return (pointer)((char *)new + sizeof(header)); + } +} diff --git a/INSTALAR b/INSTALAR new file mode 100644 index 0000000..e550dea --- /dev/null +++ b/INSTALAR @@ -0,0 +1,48 @@ + INSTALACION + =========== + + Dependiendo de tu sistem sigue las instrucciones. + + **************************************************************** + * ANTES DE EJECUTAR SSYSTEM ECHALE UN VISTAZO AL FICHERO DE * + * CONFIGURACION (ssystem.conf). ALLI PODRAS ACTIVAR/DESACTIVAR * + * OPCIONES QUE TE AYUDARAN A AJUSTAR EL RENDIMIENTO Y LA * + * CALIDAD VISUAL * + **************************************************************** + +LINUX/UNIX +---------- + + Librerias necesarias: + + - Librerias compatibles OpenGL 1.2 y glut 3.7. Si no estas seguro + te sugiero que te bajes Mesa 3.0 (descarga tambien la distribucion + Demos si quieres glut 3.7) + + - Libreria JPEG del Independent JPEG Group. La mayoria de los sistemas + Linux la inclyen pero si tu sistema no la incluye puedes encontrarla + en ftp://ftp.uu.net/graphics/jpeg + + Una vez que todo lo necesario este listo, edita el Makefile, ejecuta make + y ya esta ... + + +WINDOWS +------- + + -Asegurate de tener OPENGL32.DLL y GLU32.DLL. Si no es el caso puedes + descargarlas desde la homepage de ssystem + ( http://www1.las.es/~amil/ssystem ) + + NO TE BAJES MESA PARA 3DFX SI NO TIENES UNA TARJETA 3DFX MEJOR + TE BAJAS EL OPENGL DE MICROSOFT + + -El comportamiento de ssystem es algo extran~o bajo ciertos driver + OpenGL. Por lo que yo se no es problema de ssystem. Contacta con + el fabricante de tu tarjeta para conseguir unos nuevos drivers. + + -DLLs con soporte para hardware 3Dfx estan disponibles desde la + homepage de ssystem. A menos que esas DLLs esten en el directorio + donde este ssystem.exe o en el path (mejor el primer metodo) el + programa utilizara las DLLs OpenGL (si estan instaladas) y el + rendimiento sera muy pobre. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..c9a70c4 --- /dev/null +++ b/INSTALL @@ -0,0 +1,48 @@ + INSTALLATION NOTES + ================== + + Depending on your system follow the instructions below. + + + **************************************************************** + * BEFORE YOU RUN SSYSTEM TAKE A LOOK AT THE CONFIGURATION FILE * + * (ssystem.conf) THERE YOU'LL BE ABLE TO (UN)SET OPTIONS THAT * + * WILL HELP YOU TO TUNE THE PERFORMANCE AND/OR VISUAL QUALITY * + **************************************************************** + +LINUX/UNIX +---------- + + Required libraries: + + - OpenGL 1.2 compliant libraries and glut 3.7. If unsure about that + i suggest you Mesa 3.0 (download also Demos distribution if you + want glut 3.7). + + - Independent JPEG Group's JPEG library. Most Linux systems include + this library but if your system doesn't include it you can grab it + from ftp://ftp.uu.net/graphics/jpeg + + Once all required stuff is ready simply edit Makefile, run make and + hopefully it's done. + + +WINDOWS +------- + + -Make sure you have OPENGL32.DLL GLU32.DLL and GLUT32.DLL. If you + don't, download them from ssystem homepage. + ( http://www1.las.es/~amil/ssystem ) + + DO NOT DOWNLOAD THE MESA FOR 3DFX IF YOU DON'T HAVE A 3DFX CARD + DOWNLOAD THE MICROSOFT OPENGL INSTEAD. + + -ssystem's behavior is quite strange under some OpenGL drivers. + AFAIK is not ssystem's fault. Contact your card vendor for + a driver update. + + -DLLs with 3Dfx hardware support are available from ssystem homepage. + Unless these DLLs are in the same directory as ssystem.exe or in your + search path (first method is preferred) the program will use default + OpenGL DLLs (if installed) and framerate will be VERY POOR. + diff --git a/LEEME b/LEEME new file mode 100644 index 0000000..4638a3c --- /dev/null +++ b/LEEME @@ -0,0 +1,278 @@ +OpenGL ssystem 1.6 26-Feb-1999 +------------------------------ + + + +Que es ssystem: +--------------- + + Ssystem es un simulador del Sistema Solar que utiliza OpenGL. Visita + el Sol, los nueve planetas y algunos satelites (estrellas de fondo basadas + en catalogo estan tambien incluidas) con 4 modos de camara. + + +Precision: +---------- + + Aunque ssystem no es 100% preciso he intentado mantenerlos lo mas + cerca posible de la realidad. Sin embargo, el objetivo de ssystem ha sido + siempre mas un buen aspecto visual que la precision, asi que puede que + encuentres errores en los algoritmos de posicionamiento. + + Solo los planetas y la Luna estan dentro de una rango de las + posiciones reales, todos los demas satelites (aunque siguen unas orbitas + mas o menos correctas) no estan en las posiciones reales. + + +Requisitos del sistema: +----------------------- + + -Linux o Windows 95/NT + -Librerias OpenGL (probado con Mesa 2.6 y Microsoft DLLs) + -Libreria GLUT (probado con 3.6) + -Libreria JPEG (probado con 6.0.1) + -Tarjeta 3D (NO IMPRESCINDIBLE pero RECOMENDADA) + Voodoo Graphics (linux y win95/98) + Voodoo Rush (linux y win95/98) + Riva 128 (win95/98) + Riva TNT (win95/98) + Permedia (win95/98) + + Si tu chip 3d no esta incluido arriba y ssystem funciona acelerado + por hardware mandame un e-mail. + + Ver Makefile para opciones de compilacion. + + +Opciones en linea de comando: +----------------------------- + + -bench + + Aborta la ejecucion del programa tras 1000 frames, mostrando + el rendimiento + + -fullscreen [mode_string] + + Ejecuta ssystem en pantalla completa. En maquinas Linux/UNIX + no podras cambiar el modo de video asi que no es necesario + suministrar el mode_string (de hecho ssystem protestara si + lo haces) + + En la version de Windows 95/98 puedes elegir el modo de video. + Simplemente incluye una cadena de modo detras de fullscreen. + La sintaxis del modo es: + + ANCHOxALTO:PROFUNDIDAD_COLOR@REFRESCO + + El refresco es opcional. Asi, si quieres ejecutar ssystem a + 640x480 32 bits de color la linea de comandos es algo como: + + ssystem -fullscreen 640x480:32 + + If quieres un refresco de 100 Hz seria: + + ssystem -fullscreen 640x480:32@100 + + + NOTA: NO TODOS LOS MODOS DE VIDEO ESTAN SOPORTADOS. DE HECHO + SOLO UNOS POCO FUNCIONAN EN MI ORDENADOR. SI EL MODO DE VIDEO + QUE HAS SELECCIONADO NO ESTA SOPORTADO SSYSTEM UTILIZA EL + MODO DE VIDEO ACTUAL. + + +Rendimiento: +------------ + + + La aceleracion hardware no es indispensable, pero si muy recomendable + para un moviemiendo suave. Yo consigo 83fps (bajo Linux) con la opcion + "-bench" en mi Celeron 450 a 640x480:16 (con una Voodoo Graphics) y 56 fps + a 1024x768:32 (en win98 con una Riva TNT). Ssystem es un espectaculo en + este modo de video. + + El nivel de detalle de las esferas planetarias (SLICES y STACKS) es el + factor clave en el rendimiento, la gente con CPUs lentas deberia usar valores + mas bajos (ver fichero ssystem.conf). + + +Asignacion de teclas: +--------------------- + + Home/End: Selecciona el anterior/siguiente cuerpo + SHIFHT + Home/End: Selecciona el anterior/siguiente cuerpo de origen + en el modo de camara B2B + Insert: Orbita del planeta activo on/off + h : Ayuda en linea + a : Atmosfera on/off + t : Textura on/off + l : Iluminacion on/off + f : Flat/Smooth modelo de sombreado + r : Tiempo real on/off + s : Estrellas on/off + S : Graba la pantalla a un fichero (en formato JPEG) + m/M : Incrementa/decrementa el brillo de las estrellas + d : Modo demo on/off + n : Posiciona la camara cerca del planeta activo + c : Cambia entre modo de camara libre o siguendo al planeta + o/O : Mayor/Menos FOV + p : Pausa + r : Modo tiempo real on/off + b : Etiquetas para cuerpos lejanos on/off + B : Etiquetas para estrellas on/off + i : Informacion (HUD) on/off + j : Joystick on/off + Pagina Arriba/Abajo: Incrementa/decrementa la velocidad + z/Z : Incrementa/decrementa el zoom + (solo disponible en los modos de B2B y Orbiter) + + Manten apretado el SHIFT para un funcionamiento mas rapido en las + siguientes asignaciones: + + +/-: Incrementa/Decrementa el factor de tiempo + Cursores: Rotacion de camara + + +Modos de camara: +---------------- + + Hay 4 modos de camara: + + -Linked: Modo por defecto. La camara sigue al cuerpo selecionado. La + tecla 'n' es muy util en este modo. + + -Body to Body: Este modo te deja ver el cuerpo X como si estuvieses + en el cuerpo Y. + + -Orbiter: La camara se mueve alrededor del cuerpo selecionado en una + orbita circular (completa una orbita en media dia local). Prueba la + tecla de zoom 'z' en este modo. + + -Fee Camera: Puedes controlar la camara libremente con los cursosres/ + raton/joystick. + + +Movimiento de camara: +--------------------- + + -Teclado + + En el mode de camara libre los cursores rotan la camara, Pagina + Arriba/Abajo incrementan/decrementan la velocidad de la camara. + + El modo seguimiento es un poco diferente, aqui los cursores no tienen + uso. Puedes mover la camara hacia el planeta incrementando la velocidad. + Una vez estas cerca del planeta el propio programa pone la velocidad a + cero. + + -Raton + + En el modo de camara libre puedes controlar la camara con el raton + si mantienes pulsado el boton izquierdo mientras mueves el raton. + + -Joystick + + Como con el raton tienes que selecionar el modo de camara libre, + entonces activa el joystick (j). Los ejes X e Y controlan la camara y + los botones A y B la aceleration. Presionando los botones C o D se + pone la velocidad a 0 (si tu joystick solo tiene dos botones puedes + conseguir esto pulsando los dos botones simultaneamente). + + +Bugs conocidos: +--------------- + + El movimiento de los cuerpos mas exteriores es un poco trompicado. + Aunque ssystem usa aritmetica de doble precision, Mesa la utiliza de simple + internamente (mas rapida y suficientemente precisa para la mayoria de las + aplicaciones). Ajustando un poco las escalas he podido reducir este efecto + (ahora solo Caronte se ve afectado). Las buenas noticias: Se como solucionar + este efecto; las malas: sera necesario reescribir grandes porciones del + codigo fuente asi que suponho que tendra que esperar a la proxima version :-( + + Si estas viendo lineas negras a lo largo de los planetas esto no es un + bug. Ssytem utiliza por defecto texturas sin borde (que funcionan bien en + casi todo el hardware 3D) pero los driver OpenGL por software y quiza alguno + acelerado por hardware requieren texturas con borde. Edita el fichero + ssystem.conf y pon border = 1 (elimina el caracter # en la linea 18). Ciertas + tarjetas 3D no funcionan si border esta a 1 (3Dfx). + + Los modos de pantalla completa solo funcionan bajo drivers que soporten + el mode de video actual (*nix) o el modo que le hayas pasado en la linea de + comandos (win32). Si fuerzas el modo de pantalla completa y tu hardware no + soporta el modo de video ssystem no funcionara (correctamente). + + + +RECOMOCIMIENTOS: +---------------- + + +-Brian Paul (Mesa) + http://www.ssec.wisc.edu/~brianp/MesQ.html + +-Daryll Strauss (Linux Glide) + + +-David Bucciarelli (driver 3Dfx para Mesa) + http://www-hmw.caribel.pisa.it/fxmesa/index.shtml + +-Curtis L. Olson (catalogo de estrellas) + + +-Este software esta en parte basado en el trabajo de The Independent JPEG Group + + +-Los satelites Galileanos y de Saturn calculados con code extraido con permiso + de XEphem, (c) 1997 Elwood Charles Downey + http://iraf.noao.edu/~ecdowney/xephem.html + +-Algoritmo de posicionamiento de los planetas de Keith Burnett utilizado con + permiso + http://www.xylem.demon.co.uk/kepler/ + +-Nacho (beta testing) + +-Kevin Kamel (mirror en USA) + +-Rafael Barbera (truco aumento rendimiento en v1.4) + +-Aaron Worley (fichero de configuracion y bastantes ideas) + http://hirame.hiram.edu/~worleyam/hitch/index.html + +-Elias Martenson (SUN Makefile) + +-Andrey Zakhvatov (FreeBSD port) + +-Mike Oliphant y Rob Clark (grabar pantallas) + http://www.ling.ed.ac.uk/~oliphant/pyro + +-John Kilburg and Bill Spitzak (SGI Makefiles) + +-Bjorn Jonsson (texturas de Io, Europa y Saturno) + +-Larry Manley (funciones MoonPos y PlutoPos y todo el tema de VSOP87, + ver astrolib.c) + +-Tigran A. Aivazian (sugerencias y avisos de errores) + +-Axel Groll (extensive beta testing) + +-Y por supuesto, gracias a ti + + + +NOTA: +----- + + Este es mi primer programa OpenGL y esta todavia en fase de desarrollo, + asi que agradeceria vuestros comentarios. + + La critica constructiva siempre es bienvenida. :-) + + Visita la pagina de ssystem para nuevas versiones: + + http://www1.las.es/~amil/ssystem + +Raul Alonso + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a43ea21 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..48d3e19 --- /dev/null +++ b/Makefile @@ -0,0 +1,86 @@ +# +# ssystem 1.6 Makefile for pgcc/egcs compiler (+HPUX Extensions) +# +# Remove -DLINUXJOY if your linux kernel doesn't support joysticks or +# you're running other OS +# +# Even if you're running Linux, make sure your joystick driver is v1.x +# I've tested it with the v1.2.13 included in the 2.2.1 kernel. + +CC= cc + +# Your Mesa base directory +MESADIR=/opt/Mesa + +PREFIX=/opt/ssystem +BINDIR=${PREFIX}/bin +LIBDIR=${PREFIX}/lib + +# Where textures and star catalog files will be located, you may override this +# setting at run time +SDATADIR=$(LIBDIR) + +#CFLAGS = -Wall -O6 -I$(MESADIR)/include -fomit-frame-pointer -funroll-loops \ +# -fexpensive-optimizations -march=pentium -malign-loops=2 \ +# -malign-jumps=2 -malign-functions=2 -DLINUXJOY -DSDATADIR=\"${SDATADIR}\" + +CFLAGS = -Ae -I$(MESADIR)/include -I/opt/jpeg-6/include -DSDATADIR=\"${SDATADIR}\" + +LDFLAGS= -L/usr/X11R6/lib -L$(MESADIR)/lib -L/opt/jpeg-6/lib -ljpeg -lglut -lMesaGLU -lMesaGL \ + -lXext -L/usr/contrib/X11R6/lib -lXmu -lXi -lX11 -lm + +OBJ = cfgparse.tab.o lex.cfg.o ssystem.o init.o positions.o joystick.o \ + cmdline.o keyboard.o mouse.o scrnsht.o sun.o timer.o util.o astrolib.o \ + jpeg.o stars.o HPalloca.o + +LIBS = + +all: ssystem + +clean: + rm -f *.o *~ ssystem .depend cfgparse.tab.* cfgparse.output lex.cfg.c + +ssystem: $(OBJ) + $(CC) -o ssystem $(OBJ) $(LDFLAGS) $(LIBS) + +lex.cfg.c: cfglex.l cfgparse.tab.c + flex -i -Pcfg cfglex.l + +cfgparse.tab.c: cfgparse.y + bison -d -v -p cfg cfgparse.y + +isdir: + test -d $(BINDIR) || mkdirhier $(BINDIR) + test -d $(LIBDIR) || mkdirhier $(LIBDIR) + + +install: ssystem isdir + cp -f -p *.jpg $(SDATADIR) + install -c -m 0644 stars.dat $(SDATADIR) + install -c -m 0644 ssystem.conf $(SDATADIR) + install -c -m 0755 ssystem $(BINDIR) + +.c.o: + $(CC) -c $(CFLAGS) $< + +dep: + gcc -MM -I$(MESADIR)/include *.c > .depend + +# DO NOT DELETE +astrolib.o: astrolib.c vsop87.dat +cfgparse.tab.o: cfgparse.tab.c ssystem.h +cmdline.o: cmdline.c ssystem.h cfgparse.tab.h +init.o: init.c ssystem.h cfgparse.tab.h +joystick.o: joystick.c ssystem.h cfgparse.tab.h +jpeg.o: jpeg.c ssystem.h cfgparse.tab.h +keyboard.o: keyboard.c ssystem.h cfgparse.tab.h +lex.cfg.o: lex.cfg.c ssystem.h cfgparse.tab.h +mouse.o: mouse.c ssystem.h cfgparse.tab.h +positions.o: positions.c ssystem.h cfgparse.tab.h +scrnsht.o: scrnsht.c ssystem.h cfgparse.tab.h +ssystem.o: ssystem.c ssystem.h cfgparse.tab.h +stars.o: stars.c ssystem.h cfgparse.tab.h +sun.o: sun.c ssystem.h cfgparse.tab.h +timer.o: timer.c ssystem.h cfgparse.tab.h +util.o: util.c ssystem.h cfgparse.tab.h +HPalloca.o:HPalloca.c diff --git a/Makefile.FreeBSD b/Makefile.FreeBSD new file mode 100644 index 0000000..0cbc7b9 --- /dev/null +++ b/Makefile.FreeBSD @@ -0,0 +1,83 @@ +# +# ssystem 1.6 Makefile for FreeBSD +# +# Contributed by Andrey Zakhvatov +# +# You can also find a binary FreeBSD package (maybe outdated) here: +# http://www.freebsd.org/ports/astro.html + + +# C compiler +CC?= gcc + +# X Window System directory +X11BASE?= /usr/X11R6 + +# Local packages directory +LOCALBASE?= /usr/local + +# Installation directories +PREFIX?= $(X11BASE) +SDATADIR?= ${PREFIX}/share/ssystem + +# Your Mesa base directory +MESADIR?= $(X11BASE) + +# Your JPEG base directory +JPEGDIR?= $(LOCALBASE) + +CFLAGS+= -I$(X11BASE)/include -I$(MESADIR)/include -I$(JPEGDIR)/include -DSDATADIR=\"${SDATADIR}\" + +LDFLAGS= -L$(X11BASE)/lib -L$(MESADIR)/lib -L${JPEGDIR}/lib \ + -ljpeg -lglut -lMesaGLU -lMesaGL -lXext -lXmu -lX11 -lXi -lm + +# FreeBSD specific +.ifdef PORTOBJFORMAT +.if ${PORTOBJFORMAT} == "elf" +LDFLAGS+= -Wl,-rpath,$(X11BASE)/lib +.endif +.endif + +OBJ = cfgparse.tab.o lex.cfg.o ssystem.o init.o positions.o joystick.o \ + cmdline.o keyboard.o mouse.o scrnsht.o sun.o timer.o util.o astrolib.o \ + jpeg.o stars.o + +LIBS = + +all: ssystem + +clean: + rm -f *.o *~ ssystem .depend cfgparse.tab.* cfgparse.output lex.cfg.c + +ssystem: $(OBJ) + $(CC) -o ssystem $(OBJ) $(LDFLAGS) $(LIBS) + +lex.cfg.c: cfglex.l cfgparse.tab.c + flex -i -Pcfg cfglex.l + +cfgparse.tab.c: cfgparse.y + bison -d -v -p cfg cfgparse.y + +.c.o: + $(CC) -c $(CFLAGS) $< + +dep: + gcc -MM -I/root/Mesa-2.5/include *.c > .depend + +# DO NOT DELETE +astrolib.o: astrolib.c vsop87.dat +cfgparse.tab.o: cfgparse.tab.c ssystem.h +cmdline.o: cmdline.c ssystem.h cfgparse.tab.h +init.o: init.c ssystem.h cfgparse.tab.h +joystick.o: joystick.c ssystem.h cfgparse.tab.h +jpeg.o: jpeg.c ssystem.h cfgparse.tab.h +keyboard.o: keyboard.c ssystem.h cfgparse.tab.h +lex.cfg.o: lex.cfg.c ssystem.h cfgparse.tab.h +mouse.o: mouse.c ssystem.h cfgparse.tab.h +positions.o: positions.c ssystem.h cfgparse.tab.h +scrnsht.o: scrnsht.c ssystem.h cfgparse.tab.h +ssystem.o: ssystem.c ssystem.h cfgparse.tab.h +stars.o: stars.c ssystem.h cfgparse.tab.h +sun.o: sun.c ssystem.h cfgparse.tab.h +timer.o: timer.c ssystem.h cfgparse.tab.h +util.o: util.c ssystem.h cfgparse.tab.h diff --git a/Makefile.Sun b/Makefile.Sun new file mode 100644 index 0000000..9ae2a14 --- /dev/null +++ b/Makefile.Sun @@ -0,0 +1,66 @@ +# +# ssystem 1.6 Makefile for Sun SPARCompiler +# +# Contributed by Elias Martenson +# + +# Where the jpeg libraries are located +JPEGLIB_INCLUDE = -I/usr/local/jpeg-6b +JPEGLIB_LIB = -L/usr/local/jpeg-6b + +# Where the GLUT libraries are located +GLUT_INCLUDE = -I/usr/local/glut-3.7/include +GLUT_LIB = -L/usr/local/glut-3.7/lib + +#ssystem data directory +SDATADIR=. + +CC = cc -fast + +CFLAGS = -xCC $(JPEGLIB_INCLUDE) $(GLUT_INCLUDE) -DSDATADIR=\"$(SDATADIR)\" + +LDFLAGS= $(JPEGLIB_LIB) $(GLUT_LIB) -ljpeg -lglut -lGLU -lGL -lXext -lXmu -lX11 -lm + +OBJ = cfgparse.tab.o lex.cfg.o ssystem.o init.o positions.o joystick.o \ + cmdline.o keyboard.o mouse.o scrnsht.o sun.o timer.o util.o astrolib.o \ + jpeg.o stars.o + +LIBS = + +all: ssystem + +clean: + rm -f *.o *~ ssystem .depend cfgparse.tab.* cfgparse.output lex.cfg.c + +ssystem: $(OBJ) + $(CC) -o ssystem $(OBJ) $(LDFLAGS) $(LIBS) + +lex.cfg.c: cfglex.l cfgparse.tab.c + flex -i -Pcfg cfglex.l + +cfgparse.tab.c: cfgparse.y + bison -d -v -p cfg cfgparse.y + +.c.o: + $(CC) -c $(CFLAGS) $< + +dep: + gcc -MM $(JPEGLIB_INCLUDE) $(GLUT_INCLUDE) *.c > .depend + +# DO NOT DELETE +astrolib.o: astrolib.c vsop87.dat +cfgparse.tab.o: cfgparse.tab.c ssystem.h +cmdline.o: cmdline.c ssystem.h cfgparse.tab.h +init.o: init.c ssystem.h cfgparse.tab.h +joystick.o: joystick.c ssystem.h cfgparse.tab.h +jpeg.o: jpeg.c ssystem.h cfgparse.tab.h +keyboard.o: keyboard.c ssystem.h cfgparse.tab.h +lex.cfg.o: lex.cfg.c ssystem.h cfgparse.tab.h +mouse.o: mouse.c ssystem.h cfgparse.tab.h +positions.o: positions.c ssystem.h cfgparse.tab.h +scrnsht.o: scrnsht.c ssystem.h cfgparse.tab.h +ssystem.o: ssystem.c ssystem.h cfgparse.tab.h +stars.o: stars.c ssystem.h cfgparse.tab.h +sun.o: sun.c ssystem.h cfgparse.tab.h +timer.o: timer.c ssystem.h cfgparse.tab.h +util.o: util.c ssystem.h cfgparse.tab.h diff --git a/Makefile.cln b/Makefile.cln new file mode 100644 index 0000000..94dc511 --- /dev/null +++ b/Makefile.cln @@ -0,0 +1,80 @@ +# +# ssystem 1.6 Makefile for pgcc/egcs compiler +# +# Remove -DLINUXJOY if your linux kernel doesn't support joysticks or +# you're running other OS +# +# Even if you're running Linux, make sure your joystick driver is v1.x +# I've tested it with the v1.2.13 included in the 2.2.1 kernel. + +CC= gcc + +# Your Mesa base directory +MESADIR=/root/Mesa-3.0 + +PREFIX=/usr/local +BINDIR=${PREFIX}/bin + +# Where textures and star catalog files will be located, you may override this +# setting at run time +SDATADIR=. + +CFLAGS = -Wall -O6 -I$(MESADIR)/include -fomit-frame-pointer -funroll-loops \ + -fexpensive-optimizations -march=pentium -malign-loops=2 \ + -malign-jumps=2 -malign-functions=2 -DLINUXJOY -DSDATADIR=\"${SDATADIR}\" + +#CFLAGS = -g -Wall -I$(MESADIR)/include -DLINUXJOY -DSDATADIR=\"${SDATADIR}\" + +LDFLAGS= -L/usr/X11R6/lib -L$(MESADIR)/lib -ljpeg -lglut -lMesaGLU -lMesaGL \ + -lXext -lXmu -lXi -lX11 -lm + +OBJ = cfgparse.tab.o lex.cfg.o ssystem.o init.o positions.o joystick.o \ + cmdline.o keyboard.o mouse.o scrnsht.o sun.o timer.o util.o astrolib.o \ + jpeg.o stars.o + +LIBS = + +all: ssystem + +clean: + rm -f *.o *~ ssystem .depend cfgparse.tab.* cfgparse.output lex.cfg.c + +ssystem: $(OBJ) + $(CC) -o ssystem $(OBJ) $(LDFLAGS) $(LIBS) + +lex.cfg.c: cfglex.l cfgparse.tab.c + flex -i -Pcfg cfglex.l + +cfgparse.tab.c: cfgparse.y + bison -d -v -p cfg cfgparse.y + +install: + install -d $(SDATADIR) + cp *.jpg $(SDATADIR) + install stars.dat $(SDATADIR) + install ssystem.conf $(SDATADIR) + install ssystem $(BINDIR) + +.c.o: + $(CC) -c $(CFLAGS) $< + +dep: + gcc -MM -I$(MESADIR)/include *.c > .depend + +# DO NOT DELETE +astrolib.o: astrolib.c vsop87.dat +cfgparse.tab.o: cfgparse.tab.c ssystem.h +cmdline.o: cmdline.c ssystem.h cfgparse.tab.h +init.o: init.c ssystem.h cfgparse.tab.h +joystick.o: joystick.c ssystem.h cfgparse.tab.h +jpeg.o: jpeg.c ssystem.h cfgparse.tab.h +keyboard.o: keyboard.c ssystem.h cfgparse.tab.h +lex.cfg.o: lex.cfg.c ssystem.h cfgparse.tab.h +mouse.o: mouse.c ssystem.h cfgparse.tab.h +positions.o: positions.c ssystem.h cfgparse.tab.h +scrnsht.o: scrnsht.c ssystem.h cfgparse.tab.h +ssystem.o: ssystem.c ssystem.h cfgparse.tab.h +stars.o: stars.c ssystem.h cfgparse.tab.h +sun.o: sun.c ssystem.h cfgparse.tab.h +timer.o: timer.c ssystem.h cfgparse.tab.h +util.o: util.c ssystem.h cfgparse.tab.h diff --git a/Makefile.gcc b/Makefile.gcc new file mode 100644 index 0000000..0058358 --- /dev/null +++ b/Makefile.gcc @@ -0,0 +1,67 @@ +# +# ssystem 1.6 Makefile for gcc compiler (for egcs/pgcc use Makefile) +# +# Remove -DLINUXJOY if your linux kernel doesn't support joysticks or +# you're running other OS +# +# Even if you're running Linux, make sure your joystick driver is v1.x +# I've tested it with the v1.2.13 included in the 2.2.1 kernel. + +CC= gcc + +# Your Mesa base directory +MESADIR=/root/Mesa-3.0 + +#ssystem data directory +SDATADIR=. + +CFLAGS = -Wall -O3 -m486 -I$(MESADIR)/include -ffast-math -funroll-loops \ + -fomit-frame-pointer -DLINUXJOY -DSDATADIR=\"$(SDATADIR)\" + +LDFLAGS= -L/usr/X11R6/lib -L$(MESADIR)/lib -ljpeg -lglut -lMesaGLU -lMesaGL \ + -lXext -lXmu -lX11 -lXi -lm + +OBJ = cfgparse.tab.o lex.cfg.o ssystem.o init.o positions.o joystick.o \ + cmdline.o keyboard.o mouse.o scrnsht.o sun.o timer.o util.o astrolib.o \ + jpeg.o stars.o + + +LIBS = + +all: ssystem + +clean: + rm -f *.o *~ ssystem .depend cfgparse.tab.* cfgparse.output lex.cfg.c + +ssystem: $(OBJ) + $(CC) -o ssystem $(OBJ) $(LDFLAGS) $(LIBS) + +lex.cfg.c: cfglex.l cfgparse.tab.c + flex -i -Pcfg cfglex.l + +cfgparse.tab.c: cfgparse.y + bison -d -v -p cfg cfgparse.y + +.c.o: + $(CC) -c $(CFLAGS) $< + +dep: + gcc -MM -I/root/Mesa-3.0/include *.c > .depend + +# DO NOT DELETE +astrolib.o: astrolib.c vsop87.dat +cfgparse.tab.o: cfgparse.tab.c ssystem.h +cmdline.o: cmdline.c ssystem.h cfgparse.tab.h +init.o: init.c ssystem.h cfgparse.tab.h +joystick.o: joystick.c ssystem.h cfgparse.tab.h +jpeg.o: jpeg.c ssystem.h cfgparse.tab.h +keyboard.o: keyboard.c ssystem.h cfgparse.tab.h +lex.cfg.o: lex.cfg.c ssystem.h cfgparse.tab.h +mouse.o: mouse.c ssystem.h cfgparse.tab.h +positions.o: positions.c ssystem.h cfgparse.tab.h +scrnsht.o: scrnsht.c ssystem.h cfgparse.tab.h +ssystem.o: ssystem.c ssystem.h cfgparse.tab.h +stars.o: stars.c ssystem.h cfgparse.tab.h +sun.o: sun.c ssystem.h cfgparse.tab.h +timer.o: timer.c ssystem.h cfgparse.tab.h +util.o: util.c ssystem.h cfgparse.tab.h diff --git a/Makefile.irix b/Makefile.irix new file mode 100644 index 0000000..4dff9eb --- /dev/null +++ b/Makefile.irix @@ -0,0 +1,67 @@ +# +# ssystem 1.6 Makefile for SGI Irix 6.2 (and probably later) +# +# By Bill Spitzak +# + +# Where the jpeg libraries are located +JPEGLIB_INCLUDE = -I/usr/include/jpeg-6b +JPEGLIB_LIB = -L/usr/lib32 + +# Where the GLUT libraries are located +GLUT_INCLUDE = -I/usr/local/glut-3.6/include +GLUT_LIB = -L/usr/local/glut-3.6/lib/glut.n32 + +#ssystem data directory +SDATADIR=. + +CC = cc -O2 -n32 + +CFLAGS = $(JPEGLIB_INCLUDE) $(GLUT_INCLUDE) -DSDATADIR=\"$(SDATADIR)\" + +LDFLAGS= $(JPEGLIB_LIB) $(GLUT_LIB) -ljpeg -lglut -lGLU -lGLS -lGL -lXext -lXmu -lX11 -lm + +OBJ = cfgparse.tab.o lex.cfg.o ssystem.o init.o positions.o joystick.o \ + cmdline.o keyboard.o mouse.o scrnsht.o sun.o timer.o util.o astrolib.o \ + jpeg.o stars.o + +LIBS = + +all: ssystem + +clean: + rm -f *.o *~ ssystem .depend cfgparse.tab.* cfgparse.output lex.cfg.c + +ssystem: $(OBJ) + $(CC) -o ssystem $(OBJ) $(LDFLAGS) $(LIBS) + +lex.cfg.c: cfglex.l cfgparse.tab.c + flex -i -Pcfg cfglex.l + +cfgparse.tab.c: cfgparse.y + bison -d -v -p cfg cfgparse.y + +install: + install -d $(SDATADIR) + cp *.jpg $(SDATADIR) + install stars.dat $(SDATADIR) + install ssystem.conf $(SDATADIR) + install ssystem $(BINDIR) + +# DO NOT DELETE +astrolib.o: astrolib.c vsop87.dat +cfgparse.tab.o: cfgparse.tab.c ssystem.h +cmdline.o: cmdline.c ssystem.h cfgparse.tab.h +init.o: init.c ssystem.h cfgparse.tab.h +joystick.o: joystick.c ssystem.h cfgparse.tab.h +jpeg.o: jpeg.c ssystem.h cfgparse.tab.h +keyboard.o: keyboard.c ssystem.h cfgparse.tab.h +lex.cfg.o: lex.cfg.c ssystem.h cfgparse.tab.h +mouse.o: mouse.c ssystem.h cfgparse.tab.h +positions.o: positions.c ssystem.h cfgparse.tab.h +scrnsht.o: scrnsht.c ssystem.h cfgparse.tab.h +ssystem.o: ssystem.c ssystem.h cfgparse.tab.h +stars.o: stars.c ssystem.h cfgparse.tab.h +sun.o: sun.c ssystem.h cfgparse.tab.h +timer.o: timer.c ssystem.h cfgparse.tab.h +util.o: util.c ssystem.h cfgparse.tab.h diff --git a/Makefile.sgi b/Makefile.sgi new file mode 100644 index 0000000..b7ec9f2 --- /dev/null +++ b/Makefile.sgi @@ -0,0 +1,67 @@ +# ssystem 1.6 Makefile for SGI IRIX +# +# Contributed by John Kilburg +# +CC= cc + +PREFIX=. +BINDIR=${PREFIX}/bin + +# Where textures and star catalog files will be located, you may override this +# setting at run time +SDATADIR=. + +GLUTINC=-I/local/glut/include +GLUTLIB=-L/local/glut/lib -lglut + +JPEGINC=-I/local/image/include +JPEGLIB=-L/local/image/lib -ljpeg + +CFLAGS = -n32 -O $(GLUTINC) $(JPEGINC) -DSDATADIR=\"$(SDATADIR)\" + +LDFLAGS= -n32 $(JPEGLIB) $(GLUTLIB) -lGLU -lGL -lXext -lXmu -lXi -lX11 -lm + +OBJ = cfgparse.tab.o lex.cfg.o ssystem.o init.o positions.o joystick.o \ + cmdline.o keyboard.o mouse.o scrnsht.o sun.o timer.o util.o astrolib.o \ + jpeg.o stars.o + +LIBS = + +all: ssystem + +clean: + rm -f *.o *~ ssystem .depend cfgparse.tab.* cfgparse.output lex.cfg.c + +ssystem: $(OBJ) + $(CC) -o ssystem $(OBJ) $(LDFLAGS) $(LIBS) + +lex.cfg.c: cfglex.l cfgparse.tab.c + flex -i -Pcfg cfglex.l + +cfgparse.tab.c: cfgparse.y + bison -d -v -p cfg cfgparse.y + +install: + install -d $(SDATADIR) + cp *.jpg $(SDATADIR) + install stars.dat $(SDATADIR) + install ssystem.conf $(SDATADIR) + install ssystem $(BINDIR) + +# DO NOT DELETE +astrolib.o: astrolib.c vsop87.dat +cfgparse.tab.o: cfgparse.tab.c ssystem.h +cmdline.o: cmdline.c ssystem.h cfgparse.tab.h +init.o: init.c ssystem.h cfgparse.tab.h +joystick.o: joystick.c ssystem.h cfgparse.tab.h +jpeg.o: jpeg.c ssystem.h cfgparse.tab.h +keyboard.o: keyboard.c ssystem.h cfgparse.tab.h +lex.cfg.o: lex.cfg.c ssystem.h cfgparse.tab.h +mouse.o: mouse.c ssystem.h cfgparse.tab.h +positions.o: positions.c ssystem.h cfgparse.tab.h +scrnsht.o: scrnsht.c ssystem.h cfgparse.tab.h +ssystem.o: ssystem.c ssystem.h cfgparse.tab.h +stars.o: stars.c ssystem.h cfgparse.tab.h +sun.o: sun.c ssystem.h cfgparse.tab.h +timer.o: timer.c ssystem.h cfgparse.tab.h +util.o: util.c ssystem.h cfgparse.tab.h diff --git a/Makefile.win b/Makefile.win new file mode 100644 index 0000000..631489b --- /dev/null +++ b/Makefile.win @@ -0,0 +1,21 @@ +!include + +MESADIR = c:\Mesa-3.0 + +CFLAGS= /Ox /G5 /GA /D__MSC__ /D__WIN32__ /DWIN32 \ + /I$(MESADIR)\include /DSDATADIR=\".\" + +LINK= $(MESADIR)\lib\OpenGL32.lib $(MESADIR)\lib\GLU32.lib \ + $(MESADIR)\lib\GLUT32.lib libjpeg.lib \ + glide2x.lib texus.lib kernel32.lib user32.lib gdi32.lib winmm.lib + +default: ssystem.exe + +ssystem.exe: ssystem.obj init.obj positions.obj joystick.obj ssystem.res + $(link) $(LINK) ssystem.obj init.obj positions.obj joystick.obj ssystem.res + +.c.obj: + $(CC) $(CFLAGS) -c $*.c + +ssystem.res: ssystem.rc + $(rc) ssystem.rc diff --git a/README b/README new file mode 100644 index 0000000..4e896e2 --- /dev/null +++ b/README @@ -0,0 +1,270 @@ +OpenGL ssystem 1.6 Feb-26-1999 +------------------------------ + + +What is ssystem: +---------------- + + ssystem is an OpenGL Solar System simulator. Visit the Sun, the + nine planets and a few major satellites (catalog based background stars are + also supported) with four camera modes. + + +Accuracy notes: +--------------- + + Although ssystem is not 100% accurate I've tried to keep it as close + to reality as possible. However, ssystem's goal has always been visual + appearence rather than accuracy, so you may find many bugs in positioning + algorithms. + + Only planets and Moon positions are within a range of real positions, + all other satellites (even though their orbits are, more or less, accurate) + are NOT in their real positions (yet). + + +System requeriments: +-------------------- + + -Linux/UNIX or Windows 95/NT OS + -OpenGL library (Mesa 3.0 recommended) + -GLUT library (v3.7 or higher required) + -JPEG library (the IJG one) + -3D accelerator (NOT REQUIRED but HIGHLY RECOMENDED) tested on: + Voodoo Graphics (linux and win95/98) + Voodoo2 (linux and win95/98) + Voodoo Rush (linux and win95/98) + Riva 128 (win95/98) + Riva TNT (win95/98) + Permedia (win95/98) + + If your 3d chipset is not listed above and ssystem runs hardware + accelerated let me know. + + See Makefile for compile time options. + + + +Command line options: +--------------------- + + -bench + + Aborts program execution after 1000 frames, displaying + framerate + + -fullscreen [mode_string] + + Runs program in full screen mode. Under Linux/UNIX machines + you won't be able to switch video modes so you don't have + to supply a mode_string (in fact, ssystem will complain if + you do so). + + Windows 95/98 version lets you choose the videomode. Just + add a mode string after the fullscreen keyword. Mode string + sintax is: + + WIDTHxHEIGHT:COLOR_DEPTH@REFRESH_RATE + + Refresh rate is optional. So if you want to run ssystem at + 640x480 32 bits colordepth your command line is something like: + + ssystem -fullscreen 640x480:32 + + If you want a 100 Hz refresh rate then type: + + sssytem -fullscreen 640x480:32@100 + + + NOTE: NOT ALL VIDEOMODES ARE SUPPORTED. ONLY A FEW ONES + WORK ON MY COMPUTER. IF THE VIDEO MODE YOU'VE SELECTED IS + NOT SUPPORTED SSYSTEM USES CURRENT VIDEO MODE. + + +Performance: +------------ + + + Hardware acceleration is not required, but highly recommended for + smooth framerates. I get 83fps (running on Linux) with the "-bench" command + line option on my Celery 450 and 56fps at 1024x768:32 (running on win98 + with a Riva TNT card). Ssystem rocks in this video mode. + + The Planets' Sphere detail (SLICES and STACKS) is the key factor in + performance, people with slow CPUs should use lower values (see ssystem.conf + file). + + +Keyboard bindings: +------------------ + + Home/End: Selects previous/next target body + SHIFT + Home/End: Selects previous/next source body in B2B camera mode + Insert: Current planet trail on/off + h : Online help + a : Atmosphere on/off + t : Texture on/off + l : Lighting on/off + f : Flat/Smooth shading model + r : Real time on/off + s : Stars on/off + S : Screenshot (in JPEG format) + m/M : Increase/Decrease star brightness + d : Demo mode on/off + n : Moves camera near current planet + c : Camera modes + o/O : Wider/Narrower FOV + p : Pause + b : Distant bodies labels on/off + B : Stars labels on/off + i : Info (HUD) on/off + j : Joystick control on/off + Page Up/Down: Increase/decrease speed + z/Z: Increase/decrease zoom factor + (only available in B2B and orbiter camera modes) + + Hold SHIFT for faster operation in the following key bindings: + + +/-: Increase/Decrease time factor + Arrow keys: Rotate camera + + +Camera modes: +------------- + + There are 4 camera modes: + + -Linked: This is the default mode. Camera follows the selected body. + 'n' is very useful in this mode. + + -Body to Body: This mode lets you view body X as seen from body Y. + + -Orbiter: Camera moves around the select body in a circular orbit ( + completes an orbit in 0.5 local days). Try the zoom key 'z' in this + mode. + + -Free Camera: You control the camera with arrow keys/josytick/mouse. + + +Camera movement: +---------------- + + -Keyboard + + When in free camera mode arrow keys rotates camera, Page Up/Down + increase/decrease camera speed. + + Linked mode is a bit different, here arrow keys are useless. You can + move the camera towards the planet by increasing speed. Once you're + near the planet program sets camera speed to zero. + + + -Mouse + + In free camera mode you can control the camera with the mouse by left + clicking over the window (keep it pressed) and moving the mouse. + + -Joystick + + As with the mouse you have to select free camera mode, then activate + joystick (j). X and Y axis control camera, buttons A and B control + acceleration. Press C or D button buttons to set camera speed to 0 + (if your joystick has only two buttons you can achieve this by + pressing A and B simultaneously) + + + +Known bugs: +----------- + + Outer bodies movement is a bit jerky. Although ssystem uses double + precision floating point arithmetic, Mesa uses simple precision arithmetic + internally. Tuning scales i've been able to reduce this annoying effect + (only Charon is highly affected). The good news: I know how this effect + can be solved; the bad news: this will requiere a total rewrite of large + parts of the code so i guess it should wait for the next release :-( + + If you're seeing black lines across the planets this is not a bug. + Ssystem default to "unbordered" textures (which work fine on most 3D + hardware) but software-only OpenGL drivers and maybe some hardware + accelerated drivers requiere bordered textures. Simply edit ssystem.conf + and set border=1 (remove the # char in line 18). Some 3D hardware won't + work if border is set to 1 (3Dfx). + + Fullscreen modes will only work properly under drivers supporting + the current video mode (*nix) or the video mode you have supplied in the + command line (win32). If you force fullscreen mode and your hardware does + not support the video mode ssystem won't work (properly). + + + + +ACKNOWLEDGEMENTS: +----------------- + + +-Brian Paul (Mesa) + http://www.ssec.wisc.edu/~brianp/MesQ.html + +-Daryll Strauss (Linux Glide) + + +-David Bucciarelli (Mesa 3dfx driver) + http://www-hmw.caribel.pisa.it/fxmesa/index.shtml + +-Curtis L. Olson (star catalog stuff) + + +-This software is based in part on the work of The Independent JPEG Group + + +-Galilean and Saturn satellites computed using code extracted with + permission from XEphem, (c) 1997 Elwood Charles Downey + http://iraf.noao.edu/~ecdowney/xephem.html + +-Keith Burnett's planet positioning algorithm used with persmission. + http://www.xylem.demon.co.uk/kepler/ + +-Nacho (beta testing) + +-Kevin Kamel (US mirror) + +-Rafael Barbera (v1.4 performance improvement trick) + +-Aaron Worley and his orrery simulation (configuration file and many ideas) + http://hirame.hiram.edu/~worleyam/hitch/index.html + +-Elias Martenson (SUN Makefile) + +-Andrey Zakhvatov (FreeBSD stuff) + +-Mike Oliphant and Rob Clark (screenshot function) + http://www.ling.ed.ac.uk/~oliphant/pyro + +-John Kilburg and Bill Spitzak (SGI Makefiles) + +-Bjorn Jonsson (Io, Europa and Saturn textures) + +-Larry Manley (MoonPos, PlutoPos function and VSOP87 stuff, see astrolib.c) + +-Tigran A. Aivazian (bug reports and suggestions) + +-Axel Groll (extensive beta testing) + +-And of course, thank you :-) + + +NOTE: +----- + + This is my first OpenGL program and i guess it will be always in + development, so I'd really appreciate your feedback. + + Constructive criticism is always welcome. :-) + + Check ssytem homepage for updates and news: + + http://www1.las.es/~amil/ssystem + +Raul Alonso + diff --git a/README.3D b/README.3D new file mode 100644 index 0000000..ed77d67 --- /dev/null +++ b/README.3D @@ -0,0 +1,25 @@ + 3D HARDWARE AND BORDERED TEXTURES + ================================= + + + I haven't been able to test ssystem by myself on many 3d hardware +(only Voodoo, Riva TNT and Permedia chipsets) and all of them worked fine +with unbordered textures. With bordered textures either it won't work at all +(Voodoo) or VERY SLOW (Riva TNT). + + The bordered textures feature has been included to avoid artifacts +between adjacent texture objects when running under some OpenGL drivers +(AFAIK Microsoft OpenGL and Mesa with software-only driver). + + Don't even try to run ssystem on 3Dfx OpenGL beta 2.1, it won't work +properly (i'd say this driver is in a very early beta stage and thus contains +lots of bugs). Anyway, Mesa is faster and more stable so who cares ;-) + + If you own a 3D card but it doesn't support OpenGL, you should +download one of these Direct3D-->OpenGL wrappers. + + DIRECTGL + http://www.scitechsoft.com/gldirect.html + + Mesa 3.0 DirectX 6 driver + http://www.altsoftware.com/Fopengl.html diff --git a/TODO b/TODO new file mode 100644 index 0000000..2f6f098 --- /dev/null +++ b/TODO @@ -0,0 +1,26 @@ +- Find a hack to eliminate the "jumping planet" effect + +- More satellites + +- Shadows/Eclipses + +- Comets + +- Earth real time weather update + +- Add gravity + + - Spaceships, probes, ... + + - Scenarios (transfer orbit flights, fly-by, orbit insertion, ...) + +- Better user interface (maybe an alternative GUI version) + +- Top view map (multiwindow version?) + +Mmm, sounds great but some of these issues won't be easy to code, so if you +feel like you can help with one of those (or other things you may consider +interesting) join the ssystem development team. + + +Drop me a note: amil@las.es diff --git a/asteroid.jpg b/asteroid.jpg new file mode 100644 index 0000000..4385cda Binary files /dev/null and b/asteroid.jpg differ diff --git a/astrolib.c b/astrolib.c new file mode 100644 index 0000000..04a22fa --- /dev/null +++ b/astrolib.c @@ -0,0 +1,830 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +/* + * Astronomical library + * Written February 1999 by Larry Manley + * + * Used in ssystem with permission, thanks Larry :-) + * + * Based on information in "Astronomical Algorithms", by Jean Meeus, 1991 + * + * + * + * Here you'll find the custom functions for the nine planets and the Moon. + * They return longitude, latitude and distance from the Sun in AU (the + * MoonPos and every custom satellite funcition must return the distance + * from its host planet in planet radii) + */ + +#include +#include + +#define PI 3.14159265358979323846 +#define DEG2RAD(x) ((x)*PI/180.0) +#define RAD2DEG(x) ((x)*180.0/PI) + +#include "vsop87.dat" /* Hardcoded VSOP87 data */ + +/* Not used elsewhere yet ... but it will be */ +double JulianDay(int Y, int M, int D) +{ + double JD; + int A, B; + + if (M < 3) + { + Y -= 1; + M += 12; + } + A = (int)floor((double)Y / 100.0); + B = 2 - A + (int)floor((double)A / 4.0); + JD = floor(365.25*((double)Y+4716.0)) + floor(30.6001*((double)M+1)) + D + B - 1524.5; + + return JD; +} + +/* Planetary positioning algorithms + * Abridged VSOP87 theory + * Longitude and latitude calculated in radians + * Radius calculated in AU + */ + +double ReadTerms(double T, double *data) +{ + double sum=0.0; + int i, j; + + i=(int)data[0]; + for (j=0; j 360.0) *Long -= 360.0; + while (*Long < 0.0) *Long += 360.0; + + *Lat = -3.98202 + (sumB / 1E6); + while (*Lat > 360.0) *Lat -= 360.0; + while (*Lat < 0.0) *Lat += 360.0; + + *Rad = 40.7247248 + (sumR / 1E7); + *Long = DEG2RAD(*Long); + *Lat = DEG2RAD(*Lat); +} + + +void MoonPos(double JD, double *Long, double *Lat, double *Rad) +{ + double Lp, Lpr, D, Dr, M, Mr, Mp, Mpr, F, Fr, A1, A2, A3, E; + double T, T2, T3, T4, sumL, sumB, sumR; + + sumL = sumB = sumR = 0.0; + T = (JD - 2451545.0) / 36525.0; + T2 = T*T; + T3 = T*T2; + T4 = T3 *T; + + /* Compute moon's mean longitude , in degrees */ + Lp = 218.3164591 + (481267.88134236 * T) - (0.0013268 * T2) + + (T3 / 538841.0) - (T4 / 65194000); + while (Lp > 360.0) Lp -= 360.0; + while (Lp < 0.0) Lp += 360.0; + Lpr = DEG2RAD(Lp); /* Create radians version for trig functions below */ + + /* Mean elongation of the moon , in degrees */ + D = 297.8502042 + (445267.1115168 * T) - (0.0016300 * T2) + + (T3 / 545868.0) - (T4 / 113065000.0); + while (D > 360.0) D -= 360.0; + while (D < 0.0) D += 360.0; + Dr = DEG2RAD(D); + + /* Sun's mean anomaly , in degrees */ + M = 357.5291092 + (35999.0502909 * T) - (0.0001536 * T2) + + (T3 / 24490000.0); + while (M > 360.0) M -= 360.0; + while (M < 0.0) M += 360.0; + Mr = DEG2RAD(M); + + /* Moon's mean anomaly , in degrees */ + Mp = 134.9634114 + (477198.8676313 * T) + (0.0089970 * T2) + + (T3 / 69699.0) - (T4 / 14712000.0); + while (Mp > 360.0) Mp -= 360.0; + while (Mp < 0.0) Mp += 360.0; + Mpr = DEG2RAD(Mp); + + /* Moon's argument of latitude */ + F = 93.2720993 + (483202.0175273 * T) - (0.0034029 * T2) - + (T3 / 3526000.0) + (T4 / 863310000.0); + while (F > 360.0) F -= 360.0; + while (F < 0.0) F += 360.0; + Fr = DEG2RAD(F); + + A1 = 119.75 + (131.849 * T); + while (A1 > 360.0) A1 -= 360.0; + while (A1 < 0.0) A1 += 360.0; + + A2 = 53.09 + (479264.290 * T); + while (A2 > 360.0) A2 -= 360.0; + while (A2 < 0.0) A2 += 360.0; + + A3 = 313.45 + (481266.484 * T); + while (A3 > 360.0) A3 -= 360.0; + while (A3 < 0.0) A3 += 360.0; + + E = 1.0 - (0.002516 * T) - (0.0000074 * T2); + + A1 = DEG2RAD(A1); + A2 = DEG2RAD(A2); + A3 = DEG2RAD(A3); + + sumL += 6288774 * sin(Mpr); + sumL += 1274027 * sin(2.0*Dr - Mpr); + sumL += 658314 * sin(2.0*Dr); + sumL += 213618 * sin(2.0*Mpr); + sumL += (-185116 * sin(Mr)) * E; + sumL += -114332 * sin(2.0 * Fr); + sumL += 58793 * sin(2.0*Dr - 2.0*Mpr); + sumL += (57066 * sin(2.0*Dr - Mr - Mpr)) * E; + sumL += 53322 * sin(2.0*Dr + Mpr); + sumL += (45758 * sin(2.0*Dr - Mr)) * E; + sumL += (-40923 * sin(Mr - Mpr)) * E; + sumL += -34720 * sin(Dr); + sumL += (-30383 * sin(Mr + Mpr)) * E; + sumL += 15327 * sin(2.0*Dr - 2.0*Fr); + sumL += -12528 * sin(Mpr + 2.0*Fr); + sumL += 10980 * sin(Mpr - 2.0*Fr); + sumL += 10675 * sin(4.0*Dr - Mpr); + sumL += 10034 * sin(3.0*Mpr); + sumL += 8548 * sin(4.0*Dr - 2.0*Mpr); + sumL += (-7888 * sin(2.0*Dr + Mr - Mpr)) * E; + sumL += (-6766 * sin(2.0*Dr + Mr)) * E; + sumL += -5163 * sin(Dr - Mpr); + sumL += (4987 * sin(Dr + Mr)) * E; + sumL += (-4036 * sin(2.0*Dr - Mr + Mpr)) * E; + sumL += 3994 * sin(2.0*Dr + 2.0*Mpr); + sumL += 3861 * sin(4.0*Dr); + sumL += 3665 * sin(2.0*Dr - 3.0*Mpr); + sumL += (-2689 * sin(Mr - 2.0*Mpr)) * E; + sumL += -2602 * sin(2.0*Dr - Mpr + 2.0*Fr); + sumL += (2390 * sin(2.0*Dr - Mr - 2.0*Mpr)) * E; + sumL += -2348 * sin(Dr + Mpr); + sumL += (2236 * sin(2.0*Dr - 2.0*Mr)) * E*E; + sumL += (-2120 * sin(Mr + 2.0*Mpr)) * E; + sumL += (-2069 * sin(2.0*Mr)) * E*E; + sumL += (2048 * sin(2.0*Dr - 2.0*Mr - Mpr)) * E*E; + sumL += -1773 * sin(2.0*Dr + Mpr - 2.0*Fr); + sumL += -1595 * sin(2.0*Dr + 2.0*Fr); + sumL += (1215 * sin(4.0*Dr - Mr - Mpr)) * E; + sumL += -1110 * sin(2.0*Mpr + 2.0*Fr); + sumL += -892 * sin(3.0*Dr - Mpr); + sumL += (-810 * sin(2.0*Dr + Mr + Mpr)) * E; + sumL += (759 * sin(4.0*Dr - Mr - 2.0*Mpr)) * E; + sumL += (-713 * sin(2.0*Mr - Mpr)) * E*E; + sumL += (-700 * sin(2.0*Dr + 2.0*Mr - Mpr)) * E*E; + sumL += (691 * sin(2.0*Dr + Mr - 2.0*Mpr)) * E; + sumL += (596 * sin(2.0*Dr - Mr - 2.0*F)) * E; + sumL += 549 * sin(4.0*Dr + Mpr); + sumL += 537 * sin(4.0*Mpr); + sumL += (520 * sin(4.0*Dr - Mr)) * E; + sumL += -487 * sin(Dr - 2.0*Mpr); + sumL += (-399 * sin(2.0*Dr + Mr - 2.0*Fr)) * E; + sumL += -381 * sin(2.0*Mpr - 2.0*Fr); + sumL += (351 * sin(Dr + Mr + Mpr)) * E; + sumL += -340 * sin(3.0*Dr - 2.0*Mpr); + sumL += 330 * sin(4.0*Dr - 3.0*Mpr); + sumL += (327 * sin(2.0*Dr - Mr + 2.0*Mpr)) * E; + sumL += (-323 * sin(2.0*Mr + Mpr)) * E*E; + sumL += (299 * sin(Dr + Mr - Mpr)) * E; + sumL += 294 * sin(2.0*Dr + 3.0*Mpr); + sumL += 3958 * sin(A1); + sumL += 1962 * sin(Lpr - Fr); + sumL += 318 * sin(A2); + *Long = Lp + (sumL / 1E6); + while (*Long > 360.0) *Long -= 360.0; + while (*Long < 0.0) *Long += 360.0; + + sumB += 5128122 * sin(Fr); + sumB += 280602 * sin(Mpr + Fr); + sumB += 277693 * sin(Mpr - Fr); + sumB += 173237 * sin(2.0*Dr - Fr); + sumB += 55413 * sin(2.0*Dr - Mpr + Fr); + sumB += 46271 * sin(2.0*Dr - Mpr - Fr); + sumB += 32573 * sin(2.0*Dr + Fr); + sumB += 17198 * sin(2.0*Mpr + Fr); + sumB += 9266 * sin(2.0*Dr + Mpr - Fr); + sumB += 8822 * sin(2.0*Mpr - Fr); + sumB += (8216 * sin(2.0*Dr - Mr - Fr)) * E; + sumB += 4324 * sin(2.0*Dr - 2.0*Mpr - Fr); + sumB += 4200 * sin(2.0*Dr + Mpr + Fr); + sumB += (-3359 * sin(2.0*Dr + Mr - Fr)) * E; + sumB += (2463 * sin(2.0*Dr - Mr - Mpr + Fr)) * E; + sumB += (2211 * sin(2.0*Dr - Mr + Fr)) *E; + sumB += (2065 * sin(2.0*Dr - Mr - Mpr - Fr)) * E; + sumB += (-1870 * sin(Mr - Mpr - Fr)) * E; + sumB += 1828 * sin(4.0*Dr - Mpr - Fr); + sumB += (-1794 * sin(Mr + Fr)) * E; + sumB += -1749 * sin(3.0*Fr); + sumB += (-1565 * sin(Mr - Mpr - Fr)) * E; + sumB += -1491 * sin(Dr - Fr); + sumB += (-1475 * sin(Mr + Mpr + Fr)) * E; + sumB += (-1410 * sin(Mr + Mpr - Fr)) * E; + sumB += (-1344 * sin(Mr - Fr)) * E; + sumB += -1335 * sin(Dr - Fr); + sumB += 1107 * sin(3.0*Mpr + Fr); + sumB += 1021 * sin(4.0*Dr - Fr); + sumB += 833 * sin(4.0*Dr - Mpr + Fr); + sumB += 777 * sin(Mpr - 3.0*Fr); + sumB += 671 * sin(4.0*Dr - 2.0*Mpr + Fr); + sumB += 607 * sin(2.0*Dr - 3.0*Fr); + sumB += 596 * sin(2.0*Dr + 2.0*Mpr - Fr); + sumB += (491 * sin(2.0*Dr - Mr + Mpr - Fr)) * E; + sumB += -451 * sin(2.0*Dr - 2.0*Mpr + Fr); + sumB += 439 * sin(3.0*Mpr - Fr); + sumB += 422 * sin(2.0*Dr + 2.0*Mpr + Fr); + sumB += 421 * sin(2.0*Dr - 3.0*Mpr - Fr); + sumB += (-366 * sin(2.0*Dr + Mr - Mpr + Fr)) * E; + sumB += (-351 * sin(2.0*Dr + Mr + Fr)) * E; + sumB += 331 * sin(4.0*Dr + Fr); + sumB += (315 * sin(2.0*Dr - Mr + Mpr + Fr)) * E; + sumB += (302 * sin(2.0*Dr - 2.0*Mr - Fr)) * E*E; + sumB += -283 * sin(Mpr + 3.0*Fr); + sumB += (-229 * sin(2.0*Dr + Mr + Mpr - Fr)) * E; + sumB += (223 * sin(Dr + Mr - Fr)) * E; + sumB += (223 * sin(Dr + Mr + Fr)) * E; + sumB += (-220 * sin(Mr - 2.0*Mpr - Fr)) * E; + sumB += (-220 * sin(2.0*Dr + Mr - Mpr - Fr)) * E; + sumB += -185 * sin(Dr + Mpr + Fr); + sumB += (181 * sin(2.0*Dr - Mr - 2.0*Mpr - Fr)) * E; + sumB += (-177 * sin(Mr + 2.0*Mpr + Fr)) * E; + sumB += 176 * sin(4.0*Dr - 2.0*Mpr - Fr); + sumB += (166 * sin(4.0*Dr - Mr - Mpr - Fr)) * E; + sumB += -164 * sin(Dr + Mpr - Fr); + sumB += 132 * sin(4.0*Dr + Mpr - Fr); + sumB += -119 * sin(Dr - Mpr - Fr); + sumB += (115 * sin(4.0*Dr - Mr - Fr)) * E; + sumB += (107 * sin(2.0*Dr - 2.0*Mr + Fr)) * E; + sumB += (-2235 * sin(Lpr)); + sumB += 382 * sin(A3); + sumB += 175 * sin(A1 - Fr); + sumB += 175 * sin(A1 + Fr); + sumB += 127 * sin(Lpr - Mpr); + sumB += -115 * sin(Lpr + Mpr); + *Lat = sumB / 1E6; + while (*Lat > 360.0) *Lat -= 360.0; + while (*Lat < -360.0) *Lat += 360.0; + + sumR += -20905355 * cos(Mpr); + sumR += -3699111 * cos(2.0*Dr - Mpr); + sumR += -2955968 * cos(2.0*Dr); + sumR += -569925 * cos(2.0*Mpr); + sumR += (48888 * cos(Mr)) * E; + sumR += -3149 * cos(2.0 * Fr); + sumR += 246158 * cos(2.0*Dr - 2.0*Mpr); + sumR += (-152138 * cos(2.0*Dr - Mr - Mpr)) * E; + sumR += -170733 * cos(2.0*Dr + Mpr); + sumR += (-204586 * cos(2.0*Dr - Mr)) * E; + sumR += (-129620 * cos(Mr - Mpr)) * E; + sumR += 108743 * cos(Dr); + sumR += (104755 * cos(Mr + Mpr)) * E; + sumR += 10321 * cos(2.0*Dr - 2.0*Fr); + sumR += 79661 * cos(Mpr - 2.0*Fr); + sumR += -34782 * cos(4.0*Dr - Mpr); + sumR += -23210 * cos(3.0*Mpr); + sumR += -21636 * cos(4.0*Dr - 2.0*Mpr); + sumR += (24208 * cos(2.0*Dr + Mr - Mpr)) * E; + sumR += (30824 * cos(2.0*Dr + Mr)) * E; + sumR += -8379 * cos(Dr - Mpr); + sumR += (-16675 * cos(Dr + Mr)) * E; + sumR += (-12831 * cos(2.0*Dr - Mr + Mpr)) * E; + sumR += -10445 * cos(2.0*Dr + 2.0*Mpr); + sumR += -11650 * cos(4.0*Dr); + sumR += 14403 * cos(2.0*Dr - 3.0*Mpr); + sumR += (-7003 * cos(Mr - 2.0*Mpr)) * E; + sumR += (10056 * cos(2.0*Dr - Mr - 2.0*Mpr)) * E; + sumR += 6322 * cos(Dr + Mpr); + sumR += (-9884 * cos(2.0*Dr - 2.0*Mr)) * E*E; + sumR += (5751 * cos(Mr + 2.0*Mpr)) * E; + sumR += (-4950 * cos(2.0*Dr - 2.0*Mr - Mpr)) * E*E; + sumR += 4130 * cos(2.0*Dr + Mpr - 2.0*Fr); + sumR += (-3958 * cos(4.0*Dr - Mr - Mpr)) * E; + sumR += 3258 * cos(3.0*Dr - Mpr); + sumR += (2616 * cos(2.0*Dr + Mr + Mpr)) * E; + sumR += (-1897 * cos(4.0*Dr - Mr - 2.0*Mpr)) * E; + sumR += (-2117 * cos(2.0*Mr - Mpr)) * E*E; + sumR += (2354 * cos(2.0*Dr + 2.0*Mr - Mpr)) * E*E; + sumR += -1423 * cos(4.0*Dr + Mpr); + sumR += -1117 * cos(4.0*Mpr); + sumR += (-1571 * cos(4.0*Dr - Mr)) * E; + sumR += -1739 * cos(Dr - 2.0*Mpr); + sumR += -4421 * cos(2.0*Mpr - 2.0*Fr); + sumR += (1165 * cos(2.0*Mr + Mpr)) * E*E; + sumR += 8752 * cos(2.0*Dr - Mpr - 2.0*Fr); + *Rad = 385000.56 + (sumR / 1000.0); /* Center of Earth to center of Moon in kilometers */ + *Rad /= 6378.0; /* Return distance in Earth radii */ + *Long = DEG2RAD(*Long); + *Lat = DEG2RAD(*Lat); +} diff --git a/callisto.jpg b/callisto.jpg new file mode 100644 index 0000000..a817f15 Binary files /dev/null and b/callisto.jpg differ diff --git a/cfglex.l b/cfglex.l new file mode 100644 index 0000000..458907b --- /dev/null +++ b/cfglex.l @@ -0,0 +1,89 @@ +%{ +#include +#include "ssystem.h" + +int reserverd_word(char *s); +extern int yylineno; +#define YY_NO_UNPUT +%} + +%option noyywrap + +DIGIT [0-9] +TEXT [a-z_\-:/0-9.]* + +%% + + + +data_directory return DATA_DIR; +border return BORDER; +atmospheres return ATMOSPHERES; +openbitmap return OPENBITMAP; +filter return FILTER; +shading return SHADING; +date return DATE; +pause return PAUSE; +realtime return REALTIME; +demo return DEMO; +planets_labels return PLANETS_LABELS; +stars_labels return STARS_LABELS; +info return INFO; +star_brightness_factor return STAR_BRIGHT; +star_size return STAR_SIZE; +camera_speed return CAM_SPEED; +camera_mode return CAM_MODE; +target return TARGET; +source return SOURCE; +slices return SLICES; +stacks return STACKS; +jpeg_quality return JPEG_QUALITY; +sun return SUN; +planet return PLANET; +satellite return SATELLITE; +asteroid return ASTEROID; +atmosphere return ATMOSPHERE; +ring return RING; + + +{DIGIT}+ { cfglval.ival=atoi(yytext); return INTEGER; } + +{DIGIT}+"."{DIGIT}* { cfglval.dval=atof(yytext); return DOUBLE; } + +{TEXT} { strcpy(cfglval.name,yytext); return NAME; } + + +"\#"(.)*"\n" yylineno++; +"/*" { + register int c; + + for ( ; ; ) + { + while ( (c = input()) != '*' && + c != EOF ) + ; /* eat up text of comment */ + + if ( c == '*' ) + { + while ( (c = input()) == '*' ) + ; + if ( c == '/' ) + break; /* found the end */ + } + + if ( c == EOF ) + { + error( "EOF in comment" ); + break; + } + } + } +[ \t]+ +\n { yylineno++;} +"{" return('{'); +"}" return('}'); +"=" return('='); +";" return(';'); +. + +%% diff --git a/cfgparse.y b/cfgparse.y new file mode 100644 index 0000000..818b393 --- /dev/null +++ b/cfgparse.y @@ -0,0 +1,247 @@ +%{ +#include /* For math functions, cos(), sin(), etc. */ +#include +#include "ssystem.h" + + +void yyerror(char *s); +void SetUpRings(int, char *, float, float), SetUpAtmosphere(int, char *, float, int),SetUpBody(int, char *, float); +void InitSun(char *, double, int); +int yylex(void); +int yylineno=0; +int body_index=1,last_planet=0; +planetdata planets[MAXBODIES]; +extern FILE *cfgin; +extern int border,filter,smodel,paused,demomode,plabels,slabels,info, + realtime,cmode,currtarget,currsource,jpeg_quality; +extern float speed,star_mag; +struct tm date; +%} + +%union { + int ival; + double dval; + char name[100]; +} + +%token INTEGER +%token DOUBLE +%token NAME +%token SUN PLANET ASTEROID SATELLITE RING ATMOSPHERE +%token DATA_DIR OPENBITMAP BORDER FILTER SHADING DATE PAUSE REALTIME +%token PLANETS_LABELS STARS_LABELS INFO STAR_BRIGHT STAR_SIZE CAM_SPEED DEMO +%token ATMOSPHERES CAM_MODE TARGET SOURCE SLICES STACKS JPEG_QUALITY EOL + +%expect 3 + +%% + +input: + | input line + ; + +line: DATA_DIR '=' NAME { strcpy(texturepath,$3); } + | OPENBITMAP '=' INTEGER { openbitmap=$3; } + | ATMOSPHERES '=' INTEGER { atmospheres=$3; } + | BORDER '=' INTEGER { border=$3;} + | FILTER '=' NAME { + if (!strcmp($3,"GL_NEAREST")) filter=GL_NEAREST; + else filter=GL_LINEAR; + } + | SHADING '=' NAME { + if (strcmp($3,"GL_FLAT")) smodel=GL_SMOOTH; + else smodel=GL_FLAT; + } + | DATE '=' NAME NAME { + sscanf($3,"%d-%d-%d",&date.tm_mon,&date.tm_mday,&date.tm_year); + sscanf($4,"%d:%d:%d",&date.tm_hour,&date.tm_min,&date.tm_sec); + date.tm_mon--; + days=mktime(&date)/3600.0/24.0-10092.0; + } + | PAUSE '=' INTEGER { paused=$3; } + | REALTIME '=' INTEGER { realtime=$3; } + | DEMO '=' INTEGER { demomode=$3; } + | PLANETS_LABELS '=' INTEGER { plabels=$3; } + | STARS_LABELS '=' INTEGER { slabels=$3; } + | INFO '=' INTEGER { info=$3; } + | STAR_BRIGHT '=' DOUBLE { star_mag=$3; } + | STAR_SIZE '=' DOUBLE { star_size=$3; } + | CAM_SPEED '=' DOUBLE { speed=$3; } + | CAM_MODE '=' INTEGER { cmode=$3; } + | TARGET '=' INTEGER { currtarget=$3; } + | SOURCE '=' INTEGER { currsource=$3; } + | SLICES '=' INTEGER { slices=$3; } + | STACKS '=' INTEGER { stacks=$3; } + | JPEG_QUALITY '=' INTEGER { jpeg_quality=$3; + if ((jpeg_quality<0) || (jpeg_quality>100)) { + error("Invalid jpeg_quality value\n"); + exit(-1); + } + } + | sun + | body + ; + +sun: SUN '{' NAME DOUBLE INTEGER '}' + { + sprintf(planets[0].Name,"The Sun"); + InitSun($3,$4,$5); + } + +body: planet + | asteroid + ; + +planet: PLANET NAME '{' NAME INTEGER INTEGER INTEGER DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE INTEGER + { + strcpy(planets[body_index].Name,$2); + planets[body_index].Color[0]=$5/255.0; + planets[body_index].Color[1]=$6/255.0; + planets[body_index].Color[2]=$7/255.0; + planets[body_index].Radius=$8; + planets[body_index].xflat=$9; + planets[body_index].yflat=$10; + planets[body_index].zflat=$11; + planets[body_index].Degrees=$13; + planets[body_index].Rotation=$14; + planets[body_index].Inclination=$15*PI/180.0; + planets[body_index].AscendingNode=$16*PI/180.0; + planets[body_index].Perihelion=$17*PI/180.0; + planets[body_index].MeanDistance=DISTCORRECTION($18); + planets[body_index].DailyMotion=$19*PI/180.0; + planets[body_index].OrbitalPeriod=$20; + planets[body_index].Eccentricity=$21; + planets[body_index].MeanLongitude=$22*PI/180.0; + planets[body_index].CustomFunction=$23; + planets[body_index].Sat=0; + planets[body_index].TrailEnabled=0; + planets[body_index].Type=PLANET; + SetUpBody(body_index,$4,$12); + last_planet=body_index; + body_index++; + } + atmosphere rings satellites '}' + ; + +satellites: + | satellite + | satellites satellite + +satellite: SATELLITE NAME '{' NAME INTEGER INTEGER INTEGER DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE INTEGER + { + strcpy(planets[body_index].Name,$2); + planets[body_index].Color[0]=$5/255.0; + planets[body_index].Color[1]=$6/255.0; + planets[body_index].Color[2]=$7/255.0; + planets[body_index].Radius=$8; + planets[body_index].xflat=$9; + planets[body_index].yflat=$10; + planets[body_index].zflat=$11; + planets[body_index].Degrees=$13; + planets[body_index].Rotation=$14; + planets[body_index].Inclination=$15*PI/180.0; + planets[body_index].AscendingNode=$16*PI/180.0; + planets[body_index].Perihelion=$17*PI/180.0; + planets[body_index].MeanDistance=DISTCORRECTION($18); + planets[body_index].DailyMotion=$19*PI/180.0; + planets[body_index].OrbitalPeriod=$20; + planets[body_index].Eccentricity=$21; + planets[body_index].MeanLongitude=$22*PI/180.0; + planets[body_index].Type=SATELLITE; + planets[body_index].Sat=last_planet; + planets[body_index].CustomFunction=$23; + SetUpBody(body_index,$4,$12); + body_index++; + } + atmosphere '}' + ; + +asteroid: ASTEROID NAME '{' NAME INTEGER INTEGER INTEGER DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE INTEGER + { + strcpy(planets[body_index].Name,$2); + planets[body_index].Color[0]=$5/255.0; + planets[body_index].Color[1]=$6/255.0; + planets[body_index].Color[2]=$7/255.0; + planets[body_index].Radius=$8; + planets[body_index].xflat=$9; + planets[body_index].yflat=$10; + planets[body_index].zflat=$11; + planets[body_index].Degrees=$13; + planets[body_index].Rotation=$14; + planets[body_index].Inclination=$15*PI/180.0; + planets[body_index].AscendingNode=$16*PI/180.0; + planets[body_index].Perihelion=$17*PI/180.0; + planets[body_index].MeanDistance=DISTCORRECTION($18); + planets[body_index].DailyMotion=$19*PI/180.0; + planets[body_index].OrbitalPeriod=$20; + planets[body_index].Eccentricity=$21; + planets[body_index].MeanLongitude=$22*PI/180.0; + planets[body_index].Sat=0; + planets[body_index].CustomFunction=$23; + planets[body_index].Type=ASTEROID; + SetUpBody(body_index,$4,$12); + last_planet=body_index; + body_index++; + } + satellites '}' + ; + +atmosphere: + | ATMOSPHERE '{' NAME INTEGER INTEGER INTEGER DOUBLE DOUBLE INTEGER '}' + { + planets[body_index].Color[0]=$4/255.0; + planets[body_index].Color[1]=$5/255.0; + planets[body_index].Color[2]=$6/255.0; + planets[body_index].Radius=$7; + planets[body_index].Sat=last_planet; + planets[body_index].Type=ATMOSPHERE; + SetUpAtmosphere(body_index,$3,$8,$9); + body_index++; + } + ; + +rings: + | ring + | rings ring + ; + +ring: RING '{' NAME INTEGER INTEGER INTEGER DOUBLE DOUBLE '}' + { + planets[body_index].Color[0]=$4/255.0; + planets[body_index].Color[1]=$5/255.0; + planets[body_index].Color[2]=$6/255.0; + planets[body_index].Sat=last_planet; + planets[body_index].Type=RING; + SetUpRings(body_index,$3,$7,$8); + body_index++; + } + ; + + +%% + +void yyerror(char *s) +{ + fprintf(stderr,"%s in line %d of configuration file\n",s,yylineno); + exit(-1); +} + +/* Read configuration file */ +void ReadConfigFile(void) +{ + char s[200]; + + sprintf(s,"%s/ssystem.conf",texturepath); + cfgin=fopen(s,"rt"); + if (cfgin==NULL) { + sprintf(s,"ssystem.conf"); + cfgin=fopen(s,"rt"); + if (cfgin==NULL) { + error("Couldn't find configuration file"); + exit(-1); + } + } + yyparse(); + fclose(cfgin); + NUMBODIES=body_index; +} diff --git a/charon.jpg b/charon.jpg new file mode 100644 index 0000000..a9bc3d3 Binary files /dev/null and b/charon.jpg differ diff --git a/cmdline.c b/cmdline.c new file mode 100644 index 0000000..dbb97e4 --- /dev/null +++ b/cmdline.c @@ -0,0 +1,91 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ssystem.h" + +#ifdef WIN32 + +/* Why the hell doesn't the evil empire use the argc,argv combo? */ +void ParseCmdLineWIN32(char *s) +{ + int err=0; + char *tmp; + + tmp=strtok(s," "); + while ((tmp!=NULL) && (!err)) { + err=0; + if (tmp[0]=='-') { + if (!strcmp(tmp,"-bench")) { + bench=1; + tmp=strtok(NULL," "); + continue; + } + if (!strcmp(tmp,"-fullscreen")) { + fullscreen=1; + tmp=strtok(NULL," "); + if (tmp==NULL) continue; + if (tmp[0]!='-') { + strcpy(game_string,tmp); + tmp=strtok(NULL," "); + }; + continue; + } + err=1; + } + }; + if (err) { + error("ssystem [-bench] [-fullscreen [mode_string]]"); + exit(-1); + } + +} + +#else + +void ParseCmdLine(int n, char **s) +{ + int i=1,err=0; + + while ((i + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + Initialization routines: + + - Read texture images + - Initialize planets' data + - Create display lists + - Other initialization routines +*/ + +#include +#include +#include +#include +#ifndef __FreeBSD__ +#include +#endif +#include +#include "jpeglib.h" +#include +#include "ssystem.h" + +GLfloat LightPos[4] = {0.0, 0.0, 0.0, 1.0}; +GLfloat ambient[4] = {0.2, 0.2, 0.2, 0.0}; +GLfloat White[4] = {1.0, 1.0, 1.0, 1.0}; +GLfloat Black[4] = {0.0, 0.0, 0.0, 1.0}; +int texture=1,smodel=GL_SMOOTH,lighting=1,drawstars=1; +int Stars,red,polaris; +int ImgWidth, ImgHeight, components; +int width=640, height=480; /* default WIDTH and HEIGHT */ +planetdata planets[MAXBODIES]; +stardata stars[NUMSTARS]; +double days,timefactor=1/(24.0*60.0*2.0); /* iterarion = 30 seconds */ +int slices=16,stacks=16,NUMBODIES,border=0,filter=GL_LINEAR; +char texturepath[100]=SDATADIR; +unsigned char tmpimg[258*258*4],*open_image; +int openimgwidth=0,openimgheight=0,openbitmap=1; +extern float star_mag; + +static void SetUpTrails(void); +static void Spheroid(double, float, float, float, float, int, int, planetdata *, int); +static void Print(char *); +GLubyte *read_JPEG_file (char *, int *, int *, int *); + +void Init( void ) +{ + time_t t; + + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + t=time(NULL); + srand(t); + days=t/3600.0/24.0-10092.0; + ReadConfigFile(); + SetUpTrails(); + Print("Setting up Stars"); + InitStars(star_mag,1); + glShadeModel(smodel); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient); + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_DST_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_CULL_FACE); + glEnable(GL_DEPTH_TEST); + if (openbitmap) + free(open_image); +} + +/* A quick and dirty Print funtion for the opening screen + * + * I know it's not the best way to do this but it will only have impact in the + * loading time ;-) + */ +static void Print(char *s) +{ + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0.0,(float) width,(float) height,0.0,0.0,1.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + if (openbitmap) { + if (!openimgwidth) + open_image=read_JPEG_file("splash.jpg",&openimgwidth,&openimgheight, &components); + glPixelZoom((float)width/(float)openimgwidth,(float)height/(float)openimgheight); + glRasterPos2i(0,height-1); + glDrawPixels(openimgwidth,openimgheight,GL_RGB,GL_UNSIGNED_BYTE,open_image); + } else + glClear( GL_COLOR_BUFFER_BIT); + glColor3f(1.0,1.0,1.0); + glRasterPos2i(width/2-strlen(s)*4,height/2); + printstring(GLUT_BITMAP_8_BY_13,s); + glutSwapBuffers(); +} + +/* Spheroid drawing routine based on gluSphere Mesa function (src-glu/quadric.c) + * patched to allow multiple texture objects and flattening. + */ +static void Spheroid(double radius, float xflat, float yflat, float zflat, float randomness, int slices, int stacks, planetdata *pdata, int textured) +{ + static GLfloat rho, drho, theta, dtheta; + GLfloat x, y, z; + GLfloat s, t, ds, dt; + GLint i, j, k, imin, imax,tex; + double *rarray1,*rarray2,*tmp; + + + drho = PI / (GLfloat) stacks; + dtheta = 2.0 * PI / (GLfloat) slices; + +/* Allocate memory for surface randomness arrays */ + rarray1=malloc((slices+1)*3*sizeof(double)); + rarray2=malloc((slices+1)*3*sizeof(double)); + + if (textured) { + + if (stacks%pdata->texheight) { + error("Incorrect STACKS value, edit configuration file\n"); + exit(-1); + } + + if (slices%pdata->texwidth) { + error("Incorrect SLICES value, edit configuration file\n"); + exit(-1); + } + + ds = 1.0 / slices * pdata->texwidth; + dt = 1.0 / stacks * pdata->texheight; + t = 1.0; + imin = 0; + imax = stacks; + + + /* Initialize surface randomness arrays */ + for (i=0;i<(slices+1)*3;i++) { + rarray1[i]=(1.0-randomness)+(randomness*2.0*rand())/RAND_MAX; + rarray2[i]=(1.0-randomness)+(randomness*2.0*rand())/RAND_MAX; + } + + for (i=imin;itexheight))) t=1.0; + tmp=rarray1; + rarray1=rarray2; + rarray2=tmp; + for (k=0;k<(slices+1)*3;k++) + rarray2[k]=(1.0-randomness)+(randomness*2.0*rand())/RAND_MAX; + + for (k=0;ktexwidth;k++) { + /* Find the texture map we should apply in this iteration */ + tex=imax/pdata->texheight; + tex=(pdata->texwidth*(pdata->texheight-1)-i/tex*pdata->texwidth)+k; + glBindTexture(GL_TEXTURE_2D, pdata->textures[tex]); + glBegin( GL_QUAD_STRIP ); + s = 0.0; + /* overwrite last element with first element data */ + rarray1[(k+1)*slices/pdata->texwidth*3]=rarray1[k*slices/pdata->texwidth*3]; + rarray1[(k+1)*slices/pdata->texwidth*3+1]=rarray1[k*slices/pdata->texwidth*3+1]; + rarray1[(k+1)*slices/pdata->texwidth*3+2]=rarray1[k*slices/pdata->texwidth*3+2]; + rarray2[(k+1)*slices/pdata->texwidth*3]=rarray2[k*slices/pdata->texwidth*3]; + rarray2[(k+1)*slices/pdata->texwidth*3+1]=rarray2[k*slices/pdata->texwidth*3+1]; + rarray2[(k+1)*slices/pdata->texwidth*3+2]=rarray2[k*slices/pdata->texwidth*3+2]; + for (j=(k*slices/pdata->texwidth);j<=((k+1)*slices/pdata->texwidth);j++) { + theta = (j==slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(rho) * rarray1[j*3]; + y = cos(theta) * sin(rho) * rarray1[j*3+1]; + z = cos(rho) * rarray1[j*3+2]; + glNormal3f( x, y, z ); + glTexCoord2f(s,t); + glVertex3f( x*radius*(1.0-xflat), y*radius*(1.0-yflat), z*radius*(1.0-zflat)); + x = -sin(theta) * sin(rho+drho) * rarray2[j*3]; + y = cos(theta) * sin(rho+drho) * rarray2[j*3+1]; + z = cos(rho+drho) * rarray2[j*3+2]; + glNormal3f( x, y, z ); + glTexCoord2f(s,t-dt); + s += ds; + glVertex3f( x*radius*(1.0-xflat), y*radius*(1.0-yflat), z*radius*(1.0-zflat)); + } + glEnd(); + } + t -= dt; + } + } else { + ds=1.0/slices; + dt=1.0/stacks; + imin=0; + imax=stacks; + for (i=imin;iASTEROID) continue; + sprintf(sbuf,"Setting up trails: %s",planets[i].Name); + Print(sbuf); + planets[i].Trail=glGenLists(1); + glNewList(planets[i].Trail, GL_COMPILE ); + glColor3f(planets[i].Color[0],planets[i].Color[1],planets[i].Color[2]); + glBegin(GL_LINE_LOOP); + d=0.0; + for (j=0;j<1000;j++) { + UpdatePositions(d,i); + glVertex3f(planets[i].posx,planets[i].posy,planets[i].posz); + d+=planets[i].OrbitalPeriod/1000.0; + } + glEnd(); + glEndList(); + } +} + + + +void InitSun(char *filename, double blend, int cutlevel) +{ + static int i; + static double j; + static char *localimage; + + Print("Setting up The Sun"); + + + planets[0].Radius=2.0; /*Real Radius is 109.6*/ + planets[0].Degrees=0.0; + planets[0].DeltaRotation=0.0; + planets[0].Rotation=360.0/28.0; + planets[0].Inclination=0.0; + planets[0].Sat=0; + planets[0].posx=planets[0].posy=planets[0].posz=0.0; + sprintf(planets[0].Name,"Sun"); + + planets[0].Image = read_JPEG_file(filename,&ImgWidth,&ImgHeight,&components); + if (!planets[0].Image) { + sprintf((char *)tmpimg,"Couldn't read image %s/sun.jpg\n",texturepath); + error((char *)tmpimg); + exit(-1); + } + + localimage=malloc(128*128*4); + if (localimage==NULL) { + error("Coundn't allocate memory"); + exit(-1); + } + + for (i=0;i<(128*128);i++) { + localimage[i*4]=planets[0].Image[i*3]; + localimage[i*4+1]=planets[0].Image[i*3+1]; + localimage[i*4+2]=planets[0].Image[i*3+2]; + j=(planets[0].Image[i*3]+planets[0].Image[i*3+1]+planets[0].Image[i*3+2])*blend/3.0; + if (j<(double)cutlevel) j=0.0; + localimage[i*4+3]=j>255.0?255:(int)j; + } + + planets[0].textures=malloc(sizeof(GLuint)); + if (planets[0].textures==NULL) { + error("Coundn't allocate memory"); + exit(-1); + } + + glGenTextures(1,planets[0].textures); + glBindTexture(GL_TEXTURE_2D, planets[0].textures[0]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE); + glTexImage2D( GL_TEXTURE_2D, + 0, + 4, + ImgWidth,ImgHeight, + 0, + GL_RGBA, GL_UNSIGNED_BYTE, + localimage ); + free(planets[0].Image); + free(localimage); +} + diff --git a/init.c.cln b/init.c.cln new file mode 100644 index 0000000..89cffa2 --- /dev/null +++ b/init.c.cln @@ -0,0 +1,569 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + Initialization routines: + + - Read texture images + - Initialize planets' data + - Create display lists + - Other initialization routines +*/ + +#include +#include +#include +#include +#ifndef __FreeBSD__ +#include +#endif +#include +#include "jpeglib.h" +#include +#include "ssystem.h" + +GLfloat LightPos[4] = {0.0, 0.0, 0.0, 1.0}; +GLfloat ambient[4] = {0.2, 0.2, 0.2, 0.0}; +GLfloat White[4] = {1.0, 1.0, 1.0, 1.0}; +GLfloat Black[4] = {0.0, 0.0, 0.0, 1.0}; +int texture=1,smodel=GL_SMOOTH,lighting=1,drawstars=1; +int Stars,red,polaris; +int ImgWidth, ImgHeight, components; +int width=640, height=480; /* default WIDTH and HEIGHT */ +planetdata planets[MAXBODIES]; +stardata stars[NUMSTARS]; +double days,timefactor=1/(24.0*60.0*2.0); /* iterarion = 30 seconds */ +int slices=16,stacks=16,NUMBODIES,border=0,filter=GL_LINEAR; +char texturepath[100]=SDATADIR; +unsigned char tmpimg[258*258*4],*open_image; +int openimgwidth=0,openimgheight=0,openbitmap=1; +extern float star_mag; + +static void SetUpTrails(void); +static void Spheroid(double, float, float, float, float, int, int, planetdata *, int); +static void Print(char *); +GLubyte *read_JPEG_file (char *, int *, int *, int *); + +void Init( void ) +{ + time_t t; + + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + t=time(NULL); + srand(t); + days=t/3600.0/24.0-10092.0; + ReadConfigFile(); + SetUpTrails(); + Print("Setting up Stars"); + InitStars(star_mag,1); + glShadeModel(smodel); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient); + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_DST_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_CULL_FACE); + glEnable(GL_DEPTH_TEST); + if (openbitmap) + free(open_image); +} + +/* A quick and dirty Print funtion for the opening screen + * + * I know it's not the best way to do this but it will only have impact in the + * loading time ;-) + */ +static void Print(char *s) +{ + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0.0,(float) width,(float) height,0.0,0.0,1.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + if (openbitmap) { + if (!openimgwidth) + open_image=read_JPEG_file("splash.jpg",&openimgwidth,&openimgheight, &components); + glPixelZoom((float)width/(float)openimgwidth,(float)height/(float)openimgheight); + glRasterPos2i(0,height-1); + glDrawPixels(openimgwidth,openimgheight,GL_RGB,GL_UNSIGNED_BYTE,open_image); + } else + glClear( GL_COLOR_BUFFER_BIT); + glColor3f(1.0,1.0,1.0); + glRasterPos2i(width/2-strlen(s)*4,height/2); + printstring(GLUT_BITMAP_8_BY_13,s); + glutSwapBuffers(); +} + +/* Spheroid drawing routine based on gluSphere Mesa function (src-glu/quadric.c) + * patched to allow multiple texture objects and flattening. + */ +static void Spheroid(double radius, float xflat, float yflat, float zflat, float randomness, int slices, int stacks, planetdata *pdata, int textured) +{ + static GLfloat rho, drho, theta, dtheta; + GLfloat x, y, z; + GLfloat s, t, ds, dt; + GLint i, j, k, imin, imax,tex; + double *rarray1,*rarray2,*tmp; + + + drho = PI / (GLfloat) stacks; + dtheta = 2.0 * PI / (GLfloat) slices; + +/* Allocate memory for surface randomness arrays */ + rarray1=malloc((slices+1)*3*sizeof(double)); + rarray2=malloc((slices+1)*3*sizeof(double)); + + if (textured) { + + if (stacks%pdata->texheight) { + error("Incorrect STACKS value, edit configuration file\n"); + exit(-1); + } + + if (slices%pdata->texwidth) { + error("Incorrect SLICES value, edit configuration file\n"); + exit(-1); + } + + ds = 1.0 / slices * pdata->texwidth; + dt = 1.0 / stacks * pdata->texheight; + t = 1.0; + imin = 0; + imax = stacks; + + + /* Initialize surface randomness arrays */ + for (i=0;i<(slices+1)*3;i++) { + rarray1[i]=(1.0-randomness)+(randomness*2.0*rand())/RAND_MAX; + rarray2[i]=(1.0-randomness)+(randomness*2.0*rand())/RAND_MAX; + } + + for (i=imin;itexheight))) t=1.0; + tmp=rarray1; + rarray1=rarray2; + rarray2=tmp; + for (k=0;k<(slices+1)*3;k++) + rarray2[k]=(1.0-randomness)+(randomness*2.0*rand())/RAND_MAX; + + for (k=0;ktexwidth;k++) { + /* Find the texture map we should apply in this iteration */ + tex=imax/pdata->texheight; + tex=(pdata->texwidth*(pdata->texheight-1)-i/tex*pdata->texwidth)+k; + glBindTexture(GL_TEXTURE_2D, pdata->textures[tex]); + glBegin( GL_QUAD_STRIP ); + s = 0.0; + /* overwrite last element with first element data */ + rarray1[(k+1)*slices/pdata->texwidth*3]=rarray1[k*slices/pdata->texwidth*3]; + rarray1[(k+1)*slices/pdata->texwidth*3+1]=rarray1[k*slices/pdata->texwidth*3+1]; + rarray1[(k+1)*slices/pdata->texwidth*3+2]=rarray1[k*slices/pdata->texwidth*3+2]; + rarray2[(k+1)*slices/pdata->texwidth*3]=rarray2[k*slices/pdata->texwidth*3]; + rarray2[(k+1)*slices/pdata->texwidth*3+1]=rarray2[k*slices/pdata->texwidth*3+1]; + rarray2[(k+1)*slices/pdata->texwidth*3+2]=rarray2[k*slices/pdata->texwidth*3+2]; + for (j=(k*slices/pdata->texwidth);j<=((k+1)*slices/pdata->texwidth);j++) { + theta = (j==slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(rho) * rarray1[j*3]; + y = cos(theta) * sin(rho) * rarray1[j*3+1]; + z = cos(rho) * rarray1[j*3+2]; + glNormal3f( x, y, z ); + glTexCoord2f(s,t); + glVertex3f( x*radius*(1.0-xflat), y*radius*(1.0-yflat), z*radius*(1.0-zflat)); + x = -sin(theta) * sin(rho+drho) * rarray2[j*3]; + y = cos(theta) * sin(rho+drho) * rarray2[j*3+1]; + z = cos(rho+drho) * rarray2[j*3+2]; + glNormal3f( x, y, z ); + glTexCoord2f(s,t-dt); + s += ds; + glVertex3f( x*radius*(1.0-xflat), y*radius*(1.0-yflat), z*radius*(1.0-zflat)); + } + glEnd(); + } + t -= dt; + } + } else { + ds=1.0/slices; + dt=1.0/stacks; + imin=0; + imax=stacks; + for (i=imin;iASTEROID) continue; + sprintf(sbuf,"Setting up trails: %s",planets[i].Name); + Print(sbuf); + planets[i].Trail=glGenLists(1); + glNewList(planets[i].Trail, GL_COMPILE ); + glColor3f(planets[i].Color[0],planets[i].Color[1],planets[i].Color[2]); + glBegin(GL_LINE_LOOP); + d=0.0; + for (j=0;j<1000;j++) { + UpdatePositions(d,i); + glVertex3f(planets[i].posx,planets[i].posy,planets[i].posz); + d+=planets[i].OrbitalPeriod/1000.0; + } + glEnd(); + glEndList(); + } +} + + + +void InitSun(char *filename, double blend, int cutlevel) +{ + static int i; + static double j; + static char *localimage; + + Print("Setting up The Sun"); + + + planets[0].Radius=2.0; /*Real Radius is 109.6*/ + planets[0].Degrees=0.0; + planets[0].DeltaRotation=0.0; + planets[0].Rotation=360.0/28.0; + planets[0].Inclination=0.0; + planets[0].Sat=0; + planets[0].posx=planets[0].posy=planets[0].posz=0.0; + sprintf(planets[0].Name,"Sun"); + + planets[0].Image = read_JPEG_file(filename,&ImgWidth,&ImgHeight,&components); + if (!planets[0].Image) { + sprintf(tmpimg,"Couldn't read image %s/sun.jpg\n",texturepath); + error(tmpimg); + exit(-1); + } + + localimage=malloc(128*128*4); + if (localimage==NULL) { + error("Coundn't allocate memory"); + exit(-1); + } + + for (i=0;i<(128*128);i++) { + localimage[i*4]=planets[0].Image[i*3]; + localimage[i*4+1]=planets[0].Image[i*3+1]; + localimage[i*4+2]=planets[0].Image[i*3+2]; + j=(planets[0].Image[i*3]+planets[0].Image[i*3+1]+planets[0].Image[i*3+2])*blend/3.0; + if (j<(double)cutlevel) j=0.0; + localimage[i*4+3]=j>255.0?255:(int)j; + } + + planets[0].textures=malloc(sizeof(GLuint)); + if (planets[0].textures==NULL) { + error("Coundn't allocate memory"); + exit(-1); + } + + glGenTextures(1,planets[0].textures); + glBindTexture(GL_TEXTURE_2D, planets[0].textures[0]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE); + glTexImage2D( GL_TEXTURE_2D, + 0, + 4, + ImgWidth,ImgHeight, + 0, + GL_RGBA, GL_UNSIGNED_BYTE, + localimage ); + free(planets[0].Image); + free(localimage); +} + diff --git a/io.jpg b/io.jpg new file mode 100644 index 0000000..e47923c Binary files /dev/null and b/io.jpg differ diff --git a/joystick.c b/joystick.c new file mode 100644 index 0000000..e0d5cf5 --- /dev/null +++ b/joystick.c @@ -0,0 +1,153 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ssystem.h" +#ifdef LINUXJOY +#include +#include +#include +#include +#endif +#ifdef WIN32 +#include +#endif + +/* + And another function based on David Bucciarelli's demos. +*/ + +int joyavailable=0,joyactive=0,joy_fd; +char axes=2; +char buttons=2; +int version=0x000800; +int *axis; +int *button; + +void joystick(void) +{ +#ifdef WIN32 + MMRESULT res; + JOYINFO joy; + static double xx,yy,zz; + static int x,y; + + res=joyGetPos(JOYSTICKID1,&joy); + + if(res==JOYERR_NOERROR) { + joyavailable=1; + x=(joy.wXpos>>12)-8; + y=(joy.wYpos>>12)-8; + if ((x<2) && (x>-2)) x=0; + if ((y<2) && (y>-2)) y=0; + if(joyactive) { + if (x) + Rotation(x*0.001,upx,upy,upz,&eyex,&eyey,&eyez); + if (y) { + xx=upy*eyez-upz*eyey; + yy=-upx*eyez+upz*eyex; + zz=upx*eyey-upy*eyex; + Rotation(y*0.001,xx,yy,zz,&eyex,&eyey,&eyez); + } + if(joy.wButtons & JOY_BUTTON1) + accel+=1.0E-8; + if(joy.wButtons & JOY_BUTTON2) + accel-=1.0E-8; + if((joy.wButtons & JOY_BUTTON1) & (joy.wButtons & JOY_BUTTON2) || + (joy.wButtons & JOY_BUTTON3) || (joy.wButtons & JOY_BUTTON4)) + accel=speed=0.0; + } + } else + joyavailable=0; +#endif + +#ifdef LINUXJOY + static struct js_event js; + static int status,x,y; + static double xx,yy,zz; + + + status=read(joy_fd, &js, sizeof(struct js_event)); + + if (status>0) { + switch (js.type & ~JS_EVENT_INIT) { + case JS_EVENT_BUTTON: + button[js.number]=js.value; + break; + case JS_EVENT_AXIS: + axis[js.number]=js.value; + break; + } + x=axis[0]/4096; /* 16 levels */ + y=axis[1]/4096; + } + + if(joyactive) { + if (x) Rotation(x*0.001,upx,upy,upz,&eyex,&eyey,&eyez); + if (y) { + xx=upy*eyez-upz*eyey; + yy=-upx*eyez+upz*eyex; + zz=upx*eyey-upy*eyex; + Rotation(y*0.001,xx,yy,zz,&eyex,&eyey,&eyez); + } + if(button[0]) + accel+=1.0E-8; + if(button[1]) + accel-=1.0E-8; + if((button[0] && button[1]) || button[2] || button[3]) + accel=speed=0.0; + } +#endif +} + + +void joydetect(void) +{ +#ifdef WIN32 + + MMRESULT res; + JOYINFO joy; + + res=joyGetPos(JOYSTICKID1,&joy); + if(res==JOYERR_NOERROR) + joyavailable=1; + else + joyavailable=0; + +#endif + +#ifdef LINUXJOY + + if ((joy_fd=open("/dev/js0", O_RDONLY)) < 0) + joyavailable=0; + else { + joyavailable=1; + ioctl(joy_fd, JSIOCGVERSION, &version); + ioctl(joy_fd, JSIOCGAXES, &axes); + ioctl(joy_fd, JSIOCGBUTTONS, &buttons); + + printf("%d axes %d buttons joystick detected (%d.%d.%d driver version)\n", + axes,buttons,version >> 16, (version >> 8) & 0xff, version & 0xff); + + fcntl(joy_fd, F_SETFL, O_NONBLOCK); + axis = calloc(axes, sizeof(int)); + button = calloc(buttons, sizeof(int)); + } +#endif + +} \ No newline at end of file diff --git a/jpeg.c b/jpeg.c new file mode 100644 index 0000000..f60f744 --- /dev/null +++ b/jpeg.c @@ -0,0 +1,205 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +#include +#include +#include "jpeglib.h" +#include "ssystem.h" + + +/*******************************************************************/ +/* JPEG DECOMPRESSION CODE EXTRACTED FROM JPEG LIBRARY SAMPLE CODE */ +/*******************************************************************/ +struct my_error_mgr { + struct jpeg_error_mgr pub; /* "public" fields */ + jmp_buf setjmp_buffer; /* for return to caller */ +}; + +typedef struct my_error_mgr * my_error_ptr; + +/* + * Here's the routine that will replace the standard error_exit method: + */ + +METHODDEF(void) +my_error_exit (j_common_ptr cinfo) +{ + /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ + my_error_ptr myerr = (my_error_ptr) cinfo->err; + + /* Always display the message. */ + /* We could postpone this until after returning, if we chose. */ + (*cinfo->err->output_message) (cinfo); + + /* Return control to the setjmp point */ + longjmp(myerr->setjmp_buffer, 1); +} + + +/* + * Sample routine for JPEG decompression. We assume that the source file name + * is passed in. We want to return 1 on success, 0 on error. + */ + + +GLubyte *read_JPEG_file (char * fname, int *width, int *height, int *components) +{ + /* This struct contains the JPEG decompression parameters and pointers to + * working space (which is allocated as needed by the JPEG library). + */ + struct jpeg_decompress_struct cinfo; + /* We use our private extension JPEG error handler. + * Note that this struct must live as long as the main JPEG parameter + * struct, to avoid dangling-pointer problems. + */ + struct my_error_mgr jerr; + /* More stuff */ + FILE * infile; /* source file */ + JSAMPARRAY buffer; /* Output row buffer */ + int row_stride; /* physical row width in output buffer */ + long cont; + JSAMPLE *image_buffer; + char filename[128]; + + /* In this example we want to open the input file before doing anything else, + * so that the setjmp() error recovery below can assume the file is open. + * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that + * requires it in order to read binary files. + */ + + sprintf(filename,"%s/%s",texturepath,fname); + if ((infile = fopen(filename, "rb")) == NULL) { + fprintf(stderr, "can't open %s\n", filename); + return NULL; + } + + /* Step 1: allocate and initialize JPEG decompression object */ + + /* We set up the normal JPEG error routines, then override error_exit. */ + cinfo.err = jpeg_std_error(&jerr.pub); + jerr.pub.error_exit = my_error_exit; + /* Establish the setjmp return context for my_error_exit to use. */ + if (setjmp(jerr.setjmp_buffer)) { + /* If we get here, the JPEG code has signaled an error. + * We need to clean up the JPEG object, close the input file, and return. + */ + jpeg_destroy_decompress(&cinfo); + fclose(infile); + return NULL; + } + /* Now we can initialize the JPEG decompression object. */ + jpeg_create_decompress(&cinfo); + + /* Step 2: specify data source (eg, a file) */ + + jpeg_stdio_src(&cinfo, infile); + + /* Step 3: read file parameters with jpeg_read_header() */ + + (void) jpeg_read_header(&cinfo, TRUE); + + /* We can ignore the return value from jpeg_read_header since + * (a) suspension is not possible with the stdio data source, and + * (b) we passed TRUE to reject a tables-only JPEG file as an error. + * See libjpeg.doc for more info. + */ + + /* Step 4: set parameters for decompression */ + + /* In this example, we don't need to change any of the defaults set by + * jpeg_read_header(), so we do nothing here. + */ + + /* Step 5: Start decompressor */ + + (void) jpeg_start_decompress(&cinfo); + /* We can ignore the return value since suspension is not possible + * with the stdio data source. + */ + + /* We may need to do some setup of our own at this point before reading + * the data. After jpeg_start_decompress() we have the correct scaled + * output image dimensions available, as well as the output colormap + * if we asked for color quantization. + * In this example, we need to make an output work buffer of the right size. + */ + /* JSAMPLEs per row in output buffer */ + row_stride = cinfo.output_width * cinfo.output_components; + /* Make a one-row-high sample array that will go away when done with image */ + buffer = (*cinfo.mem->alloc_sarray) + ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); + + /* Step 6: while (scan lines remain to be read) */ + /* jpeg_read_scanlines(...); */ + + /* Here we use the library's state variable cinfo.output_scanline as the + * loop counter, so that we don't have to keep track ourselves. + */ + + image_buffer=(JSAMPLE *) malloc(cinfo.image_width*cinfo.image_height*cinfo.output_components); + if (image_buffer==NULL) { + error("Coundn't allocate memory"); + exit(-1); + } + *width=cinfo.image_width; + *height=cinfo.image_height; + + + + cont=cinfo.output_height-1; + while (cinfo.output_scanline < cinfo.output_height) { + /* jpeg_read_scanlines expects an array of pointers to scanlines. + * Here the array is only one element long, but you could ask for + * more than one scanline at a time if that's more convenient. + */ + (void) jpeg_read_scanlines(&cinfo, buffer, 1); + /* Assume put_scanline_someplace wants a pointer and sample count. */ + /* put_scanline_someplace(buffer[0], row_stride); */ + memcpy(image_buffer+cinfo.image_width*cinfo.output_components*cont,buffer[0],row_stride); + cont--; + } + + /* Step 7: Finish decompression */ + + (void) jpeg_finish_decompress(&cinfo); + /* We can ignore the return value since suspension is not possible + * with the stdio data source. + */ + + /* Step 8: Release JPEG decompression object */ + + /* This is an important step since it will release a good deal of memory. */ + jpeg_destroy_decompress(&cinfo); + + /* After finish_decompress, we can close the input file. + * Here we postpone it until after no more JPEG errors are possible, + * so as to simplify the setjmp error logic above. (Actually, I don't + * think that jpeg_destroy can do an error exit, but why assume anything...) + */ + fclose(infile); + + /* At this point you may want to check to see whether any corrupt-data + * warnings occurred (test whether jerr.pub.num_warnings is nonzero). + */ + + /* And we're done! */ + *components=cinfo.output_components; + return image_buffer; +} diff --git a/jupiter.jpg b/jupiter.jpg new file mode 100644 index 0000000..4e72e4b Binary files /dev/null and b/jupiter.jpg differ diff --git a/keyboard.c b/keyboard.c new file mode 100644 index 0000000..8da8f0e --- /dev/null +++ b/keyboard.c @@ -0,0 +1,248 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ssystem.h" + +void Key( unsigned char key, int x, int y ) +{ + double xx,yy,zz; + + switch (key) { + case 27: /* ESC ... bye bye */ + sec=(glutGet(GLUT_ELAPSED_TIME)-sec)/1000.0; +#ifdef WIN32 + sprintf(sbuf,"\n%.2f frames/sec\n\n",(float)frames/sec); + MessageBox(NULL,sbuf,"Overall Performance", MB_OK); + if (fullscreen) glutLeaveGameMode(); + ShowCursor(TRUE); +#else + printf("\n%.2f frames/sec\n\n",(float)frames/sec); + glutSetCursor(GLUT_CURSOR_INHERIT); +#endif + exit(0); + break; + case 'c': /* Toggles camera mode */ + cmode=(cmode+1)%4; + switch (cmode) { + case 0: + upx=upz=0.0; + upy=1.0; + eyey=0.0; + break; + case 2: if (currtarget==currsource) { + currsource=(currsource+1)%NUMBODIES; + while (planets[currsource].Type==RING) + currsource=(currsource+1)%NUMBODIES; + } + break; + default: break; + } + break; + case 'p': paused=!paused; + break; + case 'f': smodel=(smodel==GL_FLAT) ? GL_SMOOTH : GL_FLAT; + glShadeModel(smodel); + break; + case 'o': if (fov<179.5) fov+=0.5; + break; + case 'O': if (fov>0.5) fov-=0.5; + break; + case 't': texture=!texture; + break; + case 'r': realtime=!realtime; + break; + case 's': drawstars=!drawstars; + break; + case 'S': sprintf(sbuf,"sshot%d.jpg",frames); + ScreenShot(sbuf); + break; + case 'm': glDeleteLists(Stars,1); + star_mag+=0.1; + InitStars(star_mag,0); + break; + case 'M': glDeleteLists(Stars,1); + star_mag-=0.1; + InitStars(star_mag,0); + break; + case 'n': /* Set camera near the current target */ + if (currtarget==0) break; + if (planets[currtarget].Type==SATELLITE) { + xx=planets[planets[currtarget].Sat].posx-planets[currtarget].posx; + yy=planets[planets[currtarget].Sat].posy-planets[currtarget].posy; + zz=planets[planets[currtarget].Sat].posz-planets[currtarget].posz; + d=DISTANCE(xx,yy,zz); + camx=planets[planets[currtarget].Sat].posx-xx/d*(d+RADIUSSCALE(planets[currtarget].Radius*8.0)); + camy=planets[planets[currtarget].Sat].posy-yy/d*(d+RADIUSSCALE(planets[currtarget].Radius*8.0)); + camz=planets[planets[currtarget].Sat].posz-zz/d*(d+RADIUSSCALE(planets[currtarget].Radius*8.0)); + eyex=planets[planets[currtarget].Sat].posx-camx; + eyey=planets[planets[currtarget].Sat].posy-camy; + eyez=planets[planets[currtarget].Sat].posz-camz; + d=DISTANCE(eyex,eyey,eyez); + eyex/=d; eyey/=d; eyez/=d; + xx=planets[currtarget].posx-planets[planets[currtarget].Sat].posx; + yy=planets[currtarget].posy-planets[planets[currtarget].Sat].posy; + zz=planets[currtarget].posz-planets[planets[currtarget].Sat].posz; + upx=0.0; + upy=1.0; + upz=-yy/zz; + } + else { + d=DISTANCE(planets[currtarget].posx, + planets[currtarget].posy,planets[currtarget].posz); + camx=planets[currtarget].posx/d* + (d-RADIUSSCALE(planets[currtarget].Radius*8.0)); + camy=planets[currtarget].posy; + camz=planets[currtarget].posz/d* + (d-RADIUSSCALE(planets[currtarget].Radius*8.0)); + eyex=planets[currtarget].posx-camx; + eyey=planets[currtarget].posy-camy; + eyez=planets[currtarget].posz-camz; + upx=0.0; upy=1.0; upz=0.0; + d=DISTANCE(eyex,eyey,eyez); + eyex/=d; eyey/=d; eyez/=d; + } + break; + case 'h': help=!help; + break; + case 'd': demomode=!demomode; + break; + case 'l': lighting=!lighting; + break; + case 'b': plabels=!plabels; + break; + case 'B': slabels=!slabels; + break; + case 'i': info=!info; + break; + case 'j': joyactive=!joyactive; + break; + case '+': if (glutGetModifiers() & GLUT_ACTIVE_SHIFT) timefactor*=1.1; + else timefactor+=1/(3600.0*24.0); /* one second/iteration */ + break; + case '-': if (glutGetModifiers() & GLUT_ACTIVE_SHIFT) timefactor/=1.1; + else timefactor-=1/(3600.0*24.0); /* one second/iteration */ + break; + case 'z': if (cmode>1) if (zoom<100.0) zoom+=1.0; + break; + case 'Z': if (cmode>1) if (zoom>5.0) zoom-=1.0; + break; + case 'a': atmospheres=!atmospheres; + break; + } +} + + +void Special(int k, int x, int y) +{ + double rot,xx,yy,zz; + int m; + + m=glutGetModifiers(); + if (m & GLUT_ACTIVE_SHIFT) rot=0.05; + else rot=0.003; + switch (k) { + case 's': if (m & GLUT_ACTIVE_CTRL){ + sprintf(sbuf,"frame%d.ppm",frames); + ScreenShot(sbuf); + } + break; + case GLUT_KEY_INSERT: if (planets[currtarget].Type<=ASTEROID) + planets[currtarget].TrailEnabled=!planets[currtarget].TrailEnabled; + break; + case GLUT_KEY_LEFT:Rotation(-rot,upx,upy,upz,&eyex,&eyey,&eyez); + break; + case GLUT_KEY_RIGHT: Rotation(rot,upx,upy,upz,&eyex,&eyey,&eyez); + break; + case GLUT_KEY_DOWN: xx=upy*eyez-upz*eyey; + yy=-upx*eyez+upz*eyex; + zz=upx*eyey-upy*eyex; + Rotation(rot,xx,yy,zz,&upx,&upy,&upz); + Rotation(rot,xx,yy,zz,&eyex,&eyey,&eyez); + break; + case GLUT_KEY_UP: xx=upy*eyez-upz*eyey; + yy=-upx*eyez+upz*eyex; + zz=upx*eyey-upy*eyex; + Rotation(-rot,xx,yy,zz,&upx,&upy,&upz); + Rotation(-rot,xx,yy,zz,&eyex,&eyey,&eyez); + break; + case GLUT_KEY_PAGE_UP: accel+=10E-7/DFACTOR; + break; + case GLUT_KEY_PAGE_DOWN: accel-=10E-7/DFACTOR; + break; + case GLUT_KEY_HOME: if (m & GLUT_ACTIVE_SHIFT) { + currsource--; + while (planets[currsource].Type>=RING) currsource--; + if (currsource<0) { + currsource=NUMBODIES-1; + while (planets[currsource].Type>=RING) currsource--; + } + if (cmode==2) + if (currsource==currtarget) { + currsource--; + while (planets[currsource].Type>=RING) + currsource--; + if (currsource<0) { + currsource=NUMBODIES-1; + while (planets[currsource].Type>=RING) currsource--; + } + } + } else { + currtarget--; + while (planets[currtarget].Type>=RING) + currtarget--; + if (currtarget<0) { + currtarget=NUMBODIES-1; + while (planets[currtarget].Type>=RING) currtarget--; + } + if (cmode==2) + if (currsource==currtarget) { + currtarget--; + while (planets[currtarget].Type>=RING) + currtarget--; + if (currtarget<0) { + currtarget=NUMBODIES-1; + while (planets[currtarget].Type>=RING) currtarget--; + } + } + } + break; + case GLUT_KEY_END: if (m & GLUT_ACTIVE_SHIFT) { + currsource=(currsource+1)%NUMBODIES; + while (planets[currsource].Type>=RING) + currsource=(currsource+1)%NUMBODIES; + if (cmode==2) + if (currsource==currtarget) { + currsource=(currsource+1)%NUMBODIES; + while (planets[currsource].Type>=RING) + currsource=(currsource+1)%NUMBODIES; + } + } else { + currtarget=(currtarget+1)%NUMBODIES; + while (planets[currtarget].Type>=RING) + currtarget=(currtarget+1)%NUMBODIES; + if (cmode==2) + if (currtarget==currsource) { + currtarget=(currtarget+1)%NUMBODIES; + while (planets[currtarget].Type>=RING) + currtarget=(currtarget+1)%NUMBODIES; + } + } + break; + } +} diff --git a/mars.jpg b/mars.jpg new file mode 100644 index 0000000..a0a877e Binary files /dev/null and b/mars.jpg differ diff --git a/mercury.jpg b/mercury.jpg new file mode 100644 index 0000000..e91d134 Binary files /dev/null and b/mercury.jpg differ diff --git a/moon.jpg b/moon.jpg new file mode 100644 index 0000000..12ecee9 Binary files /dev/null and b/moon.jpg differ diff --git a/mouse.c b/mouse.c new file mode 100644 index 0000000..3602907 --- /dev/null +++ b/mouse.c @@ -0,0 +1,46 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ssystem.h" + +static int oldmousex,oldmousey; + +void Mouse(int button, int state, int x, int y) +{ + if ((button==GLUT_LEFT_BUTTON) && (state==GLUT_DOWN)) { + oldmousex=x; + oldmousey=y; + } +} + +/* Moves camera with the mouse */ +void Motion(int x, int y) +{ + static double xx,yy,zz; + + if (!cmode) { + Rotation((x-oldmousex)/100.0,upx,upy,upz,&eyex,&eyey,&eyez); + xx=upy*eyez-upz*eyey; + yy=-upx*eyez+upz*eyex; + zz=upx*eyey-upy*eyex; + Rotation((y-oldmousey)/100.0,xx,yy,zz,&eyex,&eyey,&eyez); + } + oldmousex=x; + oldmousey=y; +} diff --git a/neptune.jpg b/neptune.jpg new file mode 100644 index 0000000..20e1991 Binary files /dev/null and b/neptune.jpg differ diff --git a/pluto.jpg b/pluto.jpg new file mode 100644 index 0000000..a97cc4f Binary files /dev/null and b/pluto.jpg differ diff --git a/positions.c b/positions.c new file mode 100644 index 0000000..b2e2343 --- /dev/null +++ b/positions.c @@ -0,0 +1,139 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +/* + + Calculate planets positions in a given date. + + The main algorithm uses elements dated Julian 2450680.5 (8/20/1997) so + it's quite accurate for dates near this. + + To be improved in the future ... + + Keith Burnett's planet positioning algorithm used with persmission. + +*/ + +#include "ssystem.h" + +static double SolveKepler(double, double); + +static double SolveKepler(double M, double ec) +{ + static double E,d,delta; + + E=M; + d=E-ec*sin(E)-M; + while (fabs(d)>1.0E-8) { + delta=d/(1.0L-ec*cos(E)); + E=E-delta; + d=E-ec*sin(E)-M; + } + return E; +} + + +/* Based on Keith Burnett's QBASIC code found here: + http://www.xylem.demon.co.uk/kepler/ +*/ +void UpdatePositions(double days, int num) +{ + static int j,k; + static double e,M,E,r,v,o,p,i,x,y,z,l,b; + + if (!num) { + j=1; + k=NUMBODIES; + } else { + j=num; + k=j+1; + } + for (j=1;j=RING) continue; + e=planets[j].Eccentricity; + M=planets[j].DailyMotion*days+planets[j].MeanLongitude-planets[j].Perihelion; + E=SolveKepler(M,e); + r=planets[j].MeanDistance*(1.0-e*cos(E)); + v=2.0L*atan(sqrt((1.0L+e)/(1.0L-e))*tan(E/2.0L)); + o=planets[j].AscendingNode; + p=planets[j].Perihelion; + i=planets[j].Inclination; + planets[j].posx=r*(cos(o)*cos(v+p-o)-sin(o)*sin(v+p-o)*cos(i)); + planets[j].posz=-r*(sin(o)*cos(v+p-o)+cos(o)*sin(v+p-o)*cos(i)); + planets[j].posy=r*(sin(v+p-o)*sin(i)); + if (planets[j].CustomFunction) { + switch(planets[j].CustomFunction) { + case 1:MercuryPos(days+2450680.5, &l, &b, &r); break; + case 2:VenusPos(days+2450680.5, &l, &b, &r); break; + case 3:EarthPos(days+2450680.5, &l, &b, &r); break; + case 4:MarsPos(days+2450680.5, &l, &b, &r); break; + case 5:JupiterPos(days+2450680.5, &l, &b, &r); break; + case 6:SaturnPos(days+2450680.5, &l, &b, &r); break; + case 7:UranusPos(days+2450680.5, &l, &b, &r); break; + case 8:NeptunePos(days+2450680.5, &l, &b, &r); break; + case 9:PlutoPos(days+2450680.5, &l, &b, &r); break; + case 10:MoonPos(days+2450680.5, &l, &b, &r); break; + } + r=DISTCORRECTION(r); + planets[j].posz=r*cos(b)*cos(l); + planets[j].posx=r*cos(b)*sin(l); + planets[j].posy=r*cos(b)*sin(b); + } + if (planets[j].Sat) { + /* satellites coords are expressed in host planet radii, convert + * to global coord ... similar to RADIUSSCALE macro */ + planets[j].posx=planets[j].posx*planets[planets[j].Sat].Radius*0.0005; + planets[j].posy=planets[j].posy*planets[planets[j].Sat].Radius*0.0005; + planets[j].posz=planets[j].posz*planets[planets[j].Sat].Radius*0.0005; + + if (!planets[j].CustomFunction) { + /* Rotate satellite to match host planet tilt + satellite orbit + * tilt. We could do this with glRotate when drawing objects + * but then we don't know real satellite coords so it's + * impossible to point the camera accurately */ + i=-atan2(planets[planets[j].Sat].posx,planets[planets[j].Sat].posz); + o=cos(i); + p=sin(i); + x = planets[j].posx*o+planets[j].posz*p; + y = planets[j].posy; + z = -planets[j].posx*p+planets[j].posz*o; + o=cos(DEG2RAD(planets[planets[j].Sat].Degrees)+planets[j].Inclination); + p=sin(DEG2RAD(planets[planets[j].Sat].Degrees)+planets[j].Inclination); + planets[j].posx = planets[planets[j].Sat].posx+x; + planets[j].posy = planets[planets[j].Sat].posy+y*o+z*p; + planets[j].posz = planets[planets[j].Sat].posz-y*p+z*o; + } else { + /* Customs functions return always corrected values */ + planets[j].posx += planets[planets[j].Sat].posx; + planets[j].posy += planets[planets[j].Sat].posy; + planets[j].posz += planets[planets[j].Sat].posz; + } + } + + /* Rotate body. Due to the rendering process (where every body is moved + * from origin to its x,y,z position) it's neccesary for us to correct + * rotation angle so we undo the implicit rotation in that translation */ + i=atan2(planets[j].posz,planets[j].posx)*180.0L/PIl; + e=planets[j].Rotation*(days/360.252502L); /* convert earth days to local */ + planets[j].DeltaRotation=(e-floor(e))*360.0L-i+85.0L; + + } +} + diff --git a/rhea.jpg b/rhea.jpg new file mode 100644 index 0000000..6d9fc64 Binary files /dev/null and b/rhea.jpg differ diff --git a/satrings.jpg b/satrings.jpg new file mode 100644 index 0000000..6d5eadc Binary files /dev/null and b/satrings.jpg differ diff --git a/saturn.jpg b/saturn.jpg new file mode 100644 index 0000000..03f3590 Binary files /dev/null and b/saturn.jpg differ diff --git a/scrnsht.c b/scrnsht.c new file mode 100644 index 0000000..fb46f2d --- /dev/null +++ b/scrnsht.c @@ -0,0 +1,76 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +#include +#include "jpeglib.h" +#include "ssystem.h" + +/* based on screenshot function from PyroTechnics v1.3 + http://www.ling.ed.ac.uk/~oliphant/pyro + + and on IJG sample code +*/ +void ScreenShot(char *filename) +{ + int i; + unsigned char *pixels; + struct jpeg_compress_struct cinfo; + struct jpeg_error_mgr jerr; + FILE * outfile; /* target file */ + JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ + int row_stride; /* physical row width in image buffer */ + + cinfo.err = jpeg_std_error(&jerr); + /* Now we can initialize the JPEG compression object. */ + jpeg_create_compress(&cinfo); + if ((outfile = fopen(filename, "wb")) == NULL) { + error("can't write screenshot\n"); + exit(-1); + } + jpeg_stdio_dest(&cinfo, outfile); + cinfo.image_width = width; /* image width and height, in pixels */ + cinfo.image_height = height; + cinfo.input_components = 3; /* # of color components per pixel */ + cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ + jpeg_set_defaults(&cinfo); + jpeg_set_quality(&cinfo, jpeg_quality, TRUE /* limit to baseline-JPEG values */); + jpeg_start_compress(&cinfo, TRUE); + + pixels=(unsigned char *)malloc(height*width*3); + glReadPixels(0,0,width,height,GL_RGB,GL_UNSIGNED_BYTE, + pixels); + + row_stride = width * 3; + i=cinfo.image_height-1; + while (i >= 0) { + /* jpeg_write_scanlines expects an array of pointers to scanlines. + * Here the array is only one element long, but you could pass + * more than one scanline at a time if that's more convenient. + */ + row_pointer[0] = & pixels[i * row_stride]; + (void) jpeg_write_scanlines(&cinfo, row_pointer, 1); + i--; + } + jpeg_finish_compress(&cinfo); + fclose(outfile); + jpeg_destroy_compress(&cinfo); + + free(pixels); +} diff --git a/splash.jpg b/splash.jpg new file mode 100644 index 0000000..d3c02fe Binary files /dev/null and b/splash.jpg differ diff --git a/ssystem.c b/ssystem.c new file mode 100644 index 0000000..ddac060 --- /dev/null +++ b/ssystem.c @@ -0,0 +1,521 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +#include +#include +#include +#ifndef __FreeBSD__ +#include +#endif +#include +#include +#include "ssystem.h" + +double camx=0.0, camy=0.0, camz=1.0, eyex=0.0, eyey=0.0, eyez=-1.0, upx=0.0, upy=1.0, upz=0.0; +float fov=37.5,fps,sec,star_mag=3.0, speed=0.0,accel=0.0,oldaccel,d,zoom=10.0,aratio; +int frames=0,paused=0,cmode=1,currsource=0,currtarget=3; +int demomode=0,bench=0,help=0,plabels=0,slabels=0,init=0; +int fullscreen=0,info=1,realtime=0,jpeg_quality=90,atmospheres=1; +char sbuf[100],game_string[20]="640x480:16"; +extern int joyavailable,joyactive; +static void Idle(void),Reshape(int,int),Camera(void), + OnScreenInfo(void),Display(void); + + +static void Reshape( int x, int y ) +{ + width=x; height=y; + if (x>y) aratio=sqrt(x*x+y*y)/y; + else aratio=sqrt(x*x+y*y)/x; + glViewport( 0, 0, width, height ); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(fov,width/(double)height,RADIUSSCALE(0.1),DISTCORRECTION(1000.0)); + glMatrixMode( GL_MODELVIEW ); +} + + +static void OnScreenInfo(void) +{ + time_t t; + struct tm *tm; + int i,j; + + glDisable(GL_TEXTURE_2D); + glDisable(GL_LIGHTING); + glDisable(GL_DEPTH_TEST); + if (slabels) { /* Star labels on ? */ + glColor3f(0.3,1.0,0.3); + i=0; + while (stars[i].magnitudeNUMSTARS) break; + glRasterPos3f(stars[i].posx,stars[i].posy,stars[i].posz); + printstring(GLUT_BITMAP_HELVETICA_10,stars[i].Name); + i++; + } + } + glColor3f(1.0,1.0,1.0); + if (plabels) /* Planets labels on ? */ + for (i=0;i=RING) continue; + if (planets[i].Type==SATELLITE) { + /* Distance from planet to camera */ + d=DISTANCE(planets[i].posx-camx,planets[i].posy-camy, + planets[i].posz-camz); + + /* If it's too far don't show satellite labels */ + if (d>DISTCORRECTION(0.1)) continue; + } + glRasterPos3f(planets[i].posx, + planets[i].posy-RADIUSSCALE(planets[i].Radius), + planets[i].posz); + printstring(GLUT_BITMAP_HELVETICA_10,planets[i].Name); + } + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0.0,(float) width,(float) height,0.0,0.0,1.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + if (help) { + i=width/2-120; + j=height/2-180; + glRasterPos2i(i,j); + printstring(GLUT_BITMAP_HELVETICA_10,"Home/End: Select previous/next body"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"SHIFT + Home/End: Selects previous/next source body in B2B camera mode"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"Insert: Current target trail on/off (planets only)"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"a : Atmosphere on/off"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"t : Texture on/off"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"l : Lighting on/off"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"f : Flat/Smooth shading model"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"s : Stars on/off"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"S : Screenshot"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"m/M : Increase/Decrease stars brightness"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"d : Demo mode on/off"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"n : Place camera near current target planet"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"c : Camera modes"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"o/O : Wider/Narrower FOV"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"p : Pause"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"r : Real Time on/off"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"b : Distant bodies labels on/off"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"B : Stars labels on/off"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"i : Info (HUD) on/off"); + if (joyavailable) { + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"j : Joystick control on/off"); + } + glRasterPos2i(i,j+=25); + printstring(GLUT_BITMAP_HELVETICA_10,"+/- : Increase/Decrease timefactor *"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"Arrow keys : Camera rotation *"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"Page Up/Down : Increase/decrease speed"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"z/Z : Increase/decrease zoom factor"); + glRasterPos2i(i,j+=15); + printstring(GLUT_BITMAP_HELVETICA_10,"* hold SHIFT for faster operation"); + } + if (!info) { + Reshape(width,height); + if (lighting) glEnable(GL_LIGHTING); + if (texture) glEnable(GL_TEXTURE_2D); + return; + } + glRasterPos2i(0,20); + t=(int) ((10092.0+days)*24.0*3600.0); + tm=localtime(&t); + strftime(sbuf,80,"%m / %d / %Y %X (Local Time)",tm); + printstring(GLUT_BITMAP_HELVETICA_10,sbuf); + if (cmode) { + glRasterPos2i(0,30); + sprintf(sbuf,"Distance from Sun (million Km): %.2f",DISTANCE(planets[currtarget].posx, + planets[currtarget].posy,planets[currtarget].posz)*DFACTOR); + printstring(GLUT_BITMAP_HELVETICA_10,sbuf); + } + glRasterPos2i(0,height-5); + sprintf(sbuf,"Camera distance from Sun (million Km): %.2f",DISTANCE(camx,camy,camz)*DFACTOR); + printstring(GLUT_BITMAP_HELVETICA_10,sbuf); + glRasterPos2i(0,height-15); + sprintf(sbuf,"Time factor: %.2f minutes / iteration",timefactor*24.0*60.0); + printstring(GLUT_BITMAP_HELVETICA_10,sbuf); + glRasterPos2i(0,height-25); + sprintf(sbuf,"Camera speed (Km / iteration): %.2f",speed*10E6*DFACTOR); + printstring(GLUT_BITMAP_HELVETICA_10,sbuf); + if (cmode>1) { + glRasterPos2i(0,height-35); + sprintf(sbuf,"Zoom factor: %.2f",10.0/zoom); + printstring(GLUT_BITMAP_HELVETICA_10,sbuf); + } + glRasterPos2i(width-120,height-5); + switch (cmode) { + case 0: printstring(GLUT_BITMAP_HELVETICA_10,"Free Camera"); + glRasterPos2i(0,10); + sprintf(sbuf," "); + break; + case 1: printstring(GLUT_BITMAP_HELVETICA_10,"Linked Camera"); + glRasterPos2i(0,10); + sprintf(sbuf,"Tracking %s",planets[currtarget].Name); + break; + case 2: printstring(GLUT_BITMAP_HELVETICA_10,"Body to Body Camera"); + glRasterPos2i(0,10); + sprintf(sbuf,"%s as seen from %s",planets[currtarget].Name,planets[currsource].Name); + break; + case 3: printstring(GLUT_BITMAP_HELVETICA_10,"Orbiter Camera"); + glRasterPos2i(0,10); + sprintf(sbuf,"Orbiting around %s",planets[currtarget].Name); + break; + default: break; + } + printstring(GLUT_BITMAP_HELVETICA_10,sbuf); + sprintf(sbuf,"FOV: %.1f FPS: %.1f",fov,fps); + glRasterPos2i(width-120,height-15); + printstring(GLUT_BITMAP_HELVETICA_10,sbuf); + if (demomode) { + glRasterPos2i(width-120,height-25); + printstring(GLUT_BITMAP_HELVETICA_10,"Demo Mode"); + } + if (paused) { + glRasterPos2i(width-30,10); + printstring(GLUT_BITMAP_HELVETICA_10,"Pause"); + } + if (joyactive && joyavailable) { + glRasterPos2i(width-70,25); + printstring(GLUT_BITMAP_HELVETICA_10,"Joystick Active"); + } + Reshape(width,height); + if (lighting) glEnable(GL_LIGHTING); + if (texture) glEnable(GL_TEXTURE_2D); +} + + +static void Idle( void ) +{ + int sat; + double rad,x,y,z,o,p; + + if (!init) { + init=1; + width=glutGet(GLUT_WINDOW_WIDTH); + height=glutGet(GLUT_WINDOW_HEIGHT); + Reshape(width,height); /* Make sure Reshape is called */ + Init(); + if (bench) days=1000.0; + UpdatePositions(days,0); + camx=planets[currtarget].posx/1.005; + camy=planets[currtarget].posy; + camz=planets[currtarget].posz/1.005; + while (planets[currtarget].Type>=RING) + currtarget=(currtarget+1)%NUMBODIES; + while (planets[currsource].Type>=RING) + currsource=(currsource+1)%NUMBODIES; + sec=glutGet(GLUT_ELAPSED_TIME); + glutDisplayFunc( Display ); + glutKeyboardFunc( Key ); + glutSpecialFunc( Special ); + glutMouseFunc( Mouse ); + glutMotionFunc( Motion ); + glutTimerFunc(10000,TimerDemo,0); + } + + + if (bench & (frames==1000)) { + sec=(glutGet(GLUT_ELAPSED_TIME)-sec)/1000.0; +#ifdef WIN32 + sprintf(sbuf,"\n%.2f frames/sec\n\n",(float)frames/sec); + MessageBox(NULL,sbuf,"Overall Performance", MB_OK); + if (fullscreen) glutLeaveGameMode(); + ShowCursor(TRUE); +#else + printf("\n%.2f frames/sec\n\n",(float)frames/sec); + glutSetCursor(GLUT_CURSOR_INHERIT); +#endif + + exit(0); + } + + if (!paused) { + /* Update positions to Julian day "days" */ + days+=timefactor; + UpdatePositions(days,0); /* 0 tells UpdatePositions to process all bodies */ + } + + if (!(frames%50)) + fps=50.0/gettime(); + if (realtime) + days=time(NULL)/3600.0/24.0-10092.0; /* days = NOW */ + + switch (cmode) { + case 2: /* Body to Body Camera, simply places the camera near the current + target with current source line view */ + if (planets[currtarget].Type==SATELLITE) { + /* If current target is a satellite take also into + account host planet data */ + sat=currtarget; + rad=RADIUSSCALE(planets[sat].Radius*zoom); + d=DISTANCE(planets[sat].posx-planets[currsource].posx, + planets[sat].posy-planets[currsource].posy, + planets[sat].posz-planets[currsource].posz); + if (rad>d) rad=d; + camx=(planets[sat].posx-planets[currsource].posx)/d* + (d-rad)+planets[currsource].posx; + camy=(planets[sat].posy-planets[currsource].posy)/d* + (d-rad)+planets[currsource].posy; + camz=(planets[sat].posz-planets[currsource].posz)/d* + (d-rad)+planets[currsource].posz; + } else { + rad=RADIUSSCALE(planets[currtarget].Radius*zoom); + d=DISTANCE(planets[currtarget].posx-planets[currsource].posx, + planets[currtarget].posy-planets[currsource].posy, + planets[currtarget].posz-planets[currsource].posz); + if (rad>d) rad=d; + camx=(planets[currtarget].posx-planets[currsource].posx)/d* + (d-rad)+planets[currsource].posx; + camy=(planets[currtarget].posy-planets[currsource].posy)/d* + (d-rad)+planets[currsource].posy; + camz=(planets[currtarget].posz-planets[currsource].posz)/d* + (d-rad)+planets[currsource].posz; + } + + upx=0.0; + upy=cos(DEG2RAD(planets[currsource].Degrees)); + upz=-sin(DEG2RAD(planets[currsource].Degrees)); + break; + + case 3: /* Orbiter Camera */ + + if (currtarget==0) break; + + /* Set Camera in equatorial orbit */ + x=RADIUSSCALE(planets[currtarget].Radius*zoom); + y=0.0; + z=0.0; + + /* Rotate camera to simulate orbit */ + Rotation(-days*10.0,0.0,1.0,0.0,&x,&y,&z); + + /* Rotate orbit plane to match planet tilt */ + o=cos(DEG2RAD(planets[currtarget].Degrees+planets[planets[currtarget].Sat].Degrees) + +planets[planets[currtarget].Sat].Inclination); + p=sin(DEG2RAD(planets[currtarget].Degrees+planets[planets[currtarget].Sat].Degrees) + +planets[planets[currtarget].Sat].Inclination); + + camx = planets[currtarget].posx+x; + camy = planets[currtarget].posy+y*o+z*p; + camz = planets[currtarget].posz+y*p+z*o; + + /* Do the same with up vector */ + x=0.0; + y=1.0; + z=0.0; + + upx = x; + upy = y*o+z*p; + upz = -y*p+z*o; + break; + + default: break; + } + if (cmode) { + /* Points camera to current active target */ + eyex=planets[currtarget].posx-camx; + eyey=planets[currtarget].posy-camy; + eyez=planets[currtarget].posz-camz; + d=DISTANCE(eyex,eyey,eyez); + eyex/=d; eyey/=d; eyez/=d; + if (d(fov/2.0*aratio+180.0/PI*atan(RADIUSSCALE(planets[j].Radius)/dist))) { + d=0.0; /* Yes, skip this body */ + glPopMatrix(); + continue; + } else + d=planets[j].Radius/fov/dist; /* No, but is it far? */ + + glPushMatrix(); + + /* Move body to its position in the orbit */ + glTranslatef(planets[j].posx,planets[j].posy,planets[j].posz); + + /* Adjust body tilt */ + glRotatef(-planets[j].Degrees-planets[planets[j].Sat].Degrees-planets[planets[j].Sat].Inclination-90.0,1.0,0.0,0.0); + + /* Rotate body around its axis */ + glRotatef(planets[j].DeltaRotation,0.0,0.0,1.0); + + if (planets[i].Type==ATMOSPHERE) + glDisable(GL_DEPTH_TEST); + + if (d>DISTCORRECTION(5.0)) { /* Body is visible and near the camera, use full detail */ + if (!texture) { + glMaterialfv(GL_FRONT, GL_AMBIENT, planets[j].Color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, planets[j].Color); + } else { + glMaterialfv(GL_FRONT, GL_AMBIENT, White); + glMaterialfv(GL_FRONT, GL_DIFFUSE, White); + } + glCallList(planets[i].Sphere); + } else if (d>DISTCORRECTION(0.1)) /* Body is visible but too far, use low detail instead */ + if (planets[i].Type<=ASTEROID) { /* Skip rings and atmosphere */ + if (texture) glDisable(GL_TEXTURE_2D); + glMaterialfv(GL_FRONT, GL_AMBIENT, planets[j].Color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, planets[j].Color); + glCallList(planets[i].Sphere+1); + if (texture) glEnable(GL_TEXTURE_2D); + } + if (planets[i].Type==RING) + if (lighting) glEnable(GL_LIGHTING); + if (planets[i].Type==ATMOSPHERE) + glEnable(GL_DEPTH_TEST); + + glPopMatrix(); + } + OnScreenInfo(); /* Draw info stuff */ + glutSwapBuffers(); + frames++; +} + + +#ifdef WIN32 +int PASCAL + WinMain(HANDLE hInst, HANDLE hPrevInst, LPSTR lpszCmndLine,int cmdShow ) +#else + int main(int argc, char *argv[]) +#endif +{ +#ifdef WIN32 + int argc=1; + char *argv[1]; + char *s="ssystem.exe"; + + argv[0]=s; +#endif + glutInitWindowSize(width,height); + glutInit( &argc, argv); +#ifdef WIN32 + ParseCmdLineWIN32(lpszCmndLine); +#else + ParseCmdLine(argc,argv); +#endif + glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); + if (fullscreen) { +#ifdef WIN32 + glutGameModeString(game_string); + glutEnterGameMode(); + ShowCursor(FALSE); +#else + glutCreateWindow( "ssystem 1.6" ); + glutFullScreen(); + glutSetCursor(GLUT_CURSOR_NONE); +#endif + } else glutCreateWindow( "ssystem 1.6" ); + + joydetect(); + demomode=!bench; + speed=-(10.0/10E6/DFACTOR); + + glutIdleFunc( Idle ); + glutReshapeFunc( Reshape ); + glutMainLoop(); + return 0; +} diff --git a/ssystem.conf b/ssystem.conf new file mode 100644 index 0000000..83e7e4f --- /dev/null +++ b/ssystem.conf @@ -0,0 +1,688 @@ +/* + ssystem 1.6 configuration file (NOT compatible with previous versions) +*/ + +/*************************************************************************** + Options +***************************************************************************/ + +#where do data files reside (stars.dat and textures) +#data_directory = . + + +#Render planet atmosphere, default is 1. Atmospheres hurt performance +#atmospheres = 0 + +#bordered textures. 0 for hardware accelerated, 1 for software-only OpenGL +#(see README.3D for details) +#border = 1 + +#show a background image during the loading stage. Set this option to 0 if +#you're running ssystem in high resolution modes (say greater than 640x480) +#openbitmap = 0 + +#Filtering method (GL_LINEAR or GL_NEAREST), default is GL_LINEAR +#GL_NEAREST filtering will increase performance on software-only OpenGL drivers +#filter = GL_NEAREST + +#Shading model (defaults to GL_SMOOTH) +#shading = GL_FLAT + +#starting date (format is MM-DD-YY HH:MM:SS) +#date = 9-21-72 7:00:00 +#date = 12-11-94 15:10:00 + +#global configuration items +#pause = 1 +#realtime = 1 +#demo = 0 +#planets_labels = 1 +#stars_labels = 1 +#info = 0 + +#how bright stars are (higher is brighter) +#star_brightness_factor = 5.0 + +#Define textured stars size. You may have to tune this value (high-res video +#modes will require lower values). Default is 0.3, typical range is (0.1-0.5). +#Try 5.0 for fun ;-) +#star_size = 0.3 + +# camera speed in millon Km per frame +#camera_speed = 0.0 + +#camera modes are: 0 (free), 1 (Linked), 2 (Body 2 Body), 3 (Orbiter) +#camera_mode = 3 + +#start with body N as target/source. (N=0 for SUN, N=1 for first body defined +# below and so on). source keyword applies only for cmode 2 +#target = 4 +#source = 0 + +#detail level, higher is better/slower. To keep texture handling functions +#happy, these two numbers must be divible by any texture width (slices) or +#height (stacks), in terms of 256x256 pieces not pixels. It's a good idea to +#use always powers of two. Anyway ssystem will tell you when invalid values +#are set +#slices = 16 +#stacks = 32 + +#Screenshots quality, (0-100). Higher is better. Default is 90 +#jpeg_quality = 100 + + +/***************************************************************************** + BODY DECLARATION + + There are two main bodies: planets and asteroids. Data referred to + these two bodies are enclosed between { } + + In every planet you can declare one atmosphere (right after planet + data) and any number of rings and/or satellites (rings declaration must + precede satellites declaration). + + You can't define atmospheres or rings in asteroid declarations, only + satellites are allowed. + + Custom function are allowed for planets, satellites and asteroids. + Note that here you assign an index to the custom function and you'll have + to edit positions.c in order to add one entry in the switch where custom + functions are called (see line 81 in positions.c). Obviously, when custom + functions are used, the elements defined in this file are ignored for that + body. + + Config file stuff is STILL IN DEVELOPMENT, so it may be buggy (works + OK with default config file but don't know with custom config files). But + as long as you define your own bodies following the rules above it should + work. You better take a look at Earth and Saturn to learn how to define + cloudy atmospheres, rings and multiple satellites. + + Whenever you find a value of 0.0 (except for the flattening and + randomness) means that this value is unknown (i mean i don't know it) + +****************************************************************************/ + +sun { + sun.jpg # texture file (must be a 128x128 24-bit JPEG) + 1.5 # blending factor, the higher this value the + 30 # better it will look (if you're running a + # software only OpenGL driver or your 3D card + # supports 32 bits rendering set this value + # to 2.0). Don't set this value above 1.5 if + # you're using a 3dfx 3D card (they don't + # support 32 bits rendering and their 16 bit + # filtering is not very good). Second number + # stands for the cut level, so pixels with + # a mean level below this value will be + # transparent. +} + +planet Mercury { + mercury.jpg # texture file + 199,160,105 # color for untextured objects (RGB triplet) + 0.382000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 6.138505 # rotation rate (in degrees/Earth day) + 7.005070 # orbit tilt (relative to ecliptic) + 48.333899 # ascendind node (degrees) + 77.453997 # perihelion (degrees) + 0.387098 # mean distance (in AU) + 4.092353 # daily motion (degrees) + 87.969002 # orbital period (Earth days) + 0.205632 # eccentricity + 314.423688 # mean longitude (degrees) + 1 # Index of custom function (0=NO) +} + +planet Venus { + venus.jpg # texture file + 249,217,170 # color for untextured objects (RGB triplet) + 0.950000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 177.300003 # body tilt + 1.481367 # rotation rate (in degrees/Earth day) + 3.394720 # orbit tilt (relative to ecliptic) + 76.688900 # ascendind node (degrees) + 131.761002 # perihelion (degrees) + 0.723324 # mean distance (in AU) + 1.602158 # daily motion (degrees) + 224.699997 # orbital period (Earth days) + 0.006793 # eccentricity + 236.940437 # mean longitude (degrees) + 2 # Index of custom function (0=NO) +} + +planet Earth { + earth.jpg # texture file + 31,94,125 # color for untextured objects (RGB triplet) + 1.000000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0034 # z axis flattening + 0.0 # surface randomness + 23.450001 # body tilt + 360.252502 # rotation rate (in degrees/Earth day) + 0.000410 # orbit tilt (relative to ecliptic) + 349.200006 # ascendind node (degrees) + 102.851700 # perihelion (degrees) + 1.000020 # mean distance (in AU) + 0.985580 # daily motion (degrees) + 365.256012 # orbital period (Earth days) + 0.016697 # eccentricity + 328.403528 # mean longitude (degrees) + 3 # Index of custom function (0=NO) + + atmosphere { + earthcld.jpg # texture file + 200,200,200 # color if untextured + 1.02 # radius (in Earth radii) + 1.3 # blending factor (useful range 1-4) + 150 # samples below this value are tranparent + } + + satellite Moon { + moon.jpg # texture file + 200,200,200 # color for untextured objects (RGB triplet) + 0.272400 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 6.410000 # body tilt + 13.176359 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 125.122795 # ascendind node (degrees) + 83.186199 # perihelion (degrees) + 60.268 # mean distance (in host planet radii) + 12.190992 # daily motion (degrees) + 27.321659 # orbital period (Earth days) + 0.054900 # eccentricity + 16.999999 # mean longitude (degrees) + 10 # Index of custom function (0=NO) + } +} + + +planet Mars { + mars.jpg # texture file + 187,153,115 # color for untextured objects (RGB triplet) + 0.532000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 25.190001 # body tilt + 350.891907 # rotation rate (in degrees/Earth day) + 1.849920 # orbit tilt (relative to ecliptic) + 49.566399 # ascendind node (degrees) + 336.088201 # perihelion (degrees) + 1.523636 # mean distance (in AU) + 0.524061 # daily motion (degrees) + 686.979980 # orbital period (Earth days) + 0.093423 # eccentricity + 262.427834 # mean longitude (degrees) + 4 # Index of custom function (0=NO) + +/*** Currently disabled due to clipping errors, remove comments to enable ***** + satellite Phobos { + asteroid.jpg # texture file + 200,200,200 # color for untextured objects (RGB triplet) + 0.04 # radius (in Earth radii) + 0.0 # x axis flattening + 0.4 # y axis flattening + 0.4 # z axis flattening + 0.06 # surface randomness + 0.0 # body tilt + 350.891907 # rotation rate (in degrees/Earth day) + 1.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 2.76 # mean distance (in host planet radii) + 1128.8451 # daily motion (degrees) + 0.318910 # orbital period (Earth days) + 0.015 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + + satellite Deimos { + asteroid.jpg # texture file + 200,200,200 # color for untextured objects (RGB triplet) + 0.02 # radius (in Earth radii) + 0.0 # x axis flattening + 0.3 # y axis flattening + 0.4 # z axis flattening + 0.07 # surface randomness + 0.0 # body tilt + 350.891907 # rotation rate (in degrees/Earth day) + 1.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 6.91 # mean distance (in host planet radii) + 285.16184 # daily motion (degrees) + 1.262441 # orbital period (Earth days) + 0.0005 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } +****************************************************************************/ +} + + +asteroid Ceres { + asteroid.jpg # texture file + 100,100,100 # color for untextured objects (RGB triplet) + 0.15 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.05 # z axis flattening + 0.07 # surface randomness + 0.0 # body tilt + 952.06 # rotation rate (in degrees/Earth day) + 10.601 # orbit tilt (relative to ecliptic) + 80.659 # ascendind node (degrees) + 71.530 # perihelion (degrees) + 2.7669 # mean distance (in AU) + 0.21414844 # daily motion (degrees) + 1656.886 # orbital period (Earth days) + 0.0760 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) +} + +asteroid Pallas { + asteroid.jpg # texture file + 100,100,100 # color for untextured objects (RGB triplet) + 0.09 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.05 # surface randomness + 0.0 # body tilt + 1106.13 # rotation rate (in degrees/Earth day) + 34.88 # orbit tilt (relative to ecliptic) + 173.298 # ascendind node (degrees) + 309.627 # perihelion (degrees) + 2.7711 # mean distance (in AU) + 0.213661 # daily motion (degrees) + 1660.66 # orbital period (Earth days) + 0.2338 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) +} + +asteroid Vesta { + asteroid.jpg # texture file + 100,100,100 # color for untextured objects (RGB triplet) + 0.09 # radius (in Earth radii) + 0.0 # x axis flattening + 0.094 # y axis flattening + 0.23 # z axis flattening + 0.07 # surface randomness + 0.0 # body tilt + 1617.37 # rotation rate (in degrees/Earth day) + 7.136 # orbit tilt (relative to ecliptic) + 103.973 # ascendind node (degrees) + 150.346 # perihelion (degrees) + 2.361 # mean distance (in AU) + 0.271682 # daily motion (degrees) + 1306.01 # orbital period (Earth days) + 0.0897 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) +} + + +planet Jupiter { + jupiter.jpg # texture file + 185,166,152 # color for untextured objects (RGB triplet) + 11.27000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0625 # z axis flattening + 0.0 # surface randomness + 3.120000 # body tilt + 870.532471 # rotation rate (in degrees/Earth day) + 1.304630 # orbit tilt (relative to ecliptic) + 100.471297 # ascendind node (degrees) + 15.697800 # perihelion (degrees) + 5.202597 # mean distance (in AU) + 0.083096 # daily motion (degrees) + 4332.586914 # orbital period (Earth days) + 0.048465 # eccentricity + 322.559836 # mean longitude (degrees) + 5 # Index of custom function (0=NO) + + satellite Io { + io.jpg # texture file + 208,200,128 # color for untextured objects (RGB triplet) + 0.285356 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 203.488937 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 5.9 # mean distance (in host planet radii) + 203.48893 # daily motion (degrees) + 1.769138 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + + satellite Europa { + europa.jpg # texture file + 202,171,143 # color for untextured objects (RGB triplet) + 0.245375 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 101.374725 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 9.39 # mean distance (in host planet radii) + 101.37473 # daily motion (degrees) + 3.551181 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + + satellite Ganymede { + ganymede.jpg # texture file + 117,117,117 # color for untextured objects (RGB triplet) + 0.413139 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 50.317608 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 14.97 # mean distance (in host planet radii) + 50.177552 # daily motion (degrees) + 7.154553 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + + satellite Callisto { + callisto.jpg # texture file + 96,96,96 # color for untextured objects (RGB triplet) + 0.379429 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 21.571070 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 26.34 # mean distance (in host planet radii) + 21.571071 # daily motion (degrees) + 16.689020 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } +} + + + +planet Saturn { + saturn.jpg # texture file + 189,174,153 # color for untextured objects (RGB triplet) + 9.500000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.1 # z axis flattening + 0.0 # surface randomness + 26.730000 # body tilt + 810.792542 # rotation rate (in degrees/Earth day) + 2.485240 # orbit tilt (relative to ecliptic) + 113.635797 # ascendind node (degrees) + 88.863001 # perihelion (degrees) + 9.571900 # mean distance (in AU) + 0.033287 # daily motion (degrees) + 10759.209961 # orbital period (Earth days) + 0.053165 # eccentricity + 20.957590 # mean longitude (degrees) + 6 # Index of custom function (0=NO) + + ring { + satrings.jpg # texture file + 150,150,150 # color if untextured + 12.0 # inner radius (in Earth radii) + 17.0 # outter radius (in Earth radii) + } + + ring { + satrings.jpg # texture file + 150,150,150 # color if untextured + 18.0 # inner radius (in Earth radii) + 19.5 # outter radius (in Earth radii) + } + + satellite Tethys { + tethys.jpg # texture file + 189,189,189 # color for untextured objects (RGB triplet) + 0.082314 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 190.668610 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 4.89 # mean distance (in host planet radii) + 190.66857 # daily motion (degrees) + 1.888093 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + + satellite Dione { + dione.jpg # texture file + 130,130,130 # color for untextured objects (RGB triplet) + 0.087802 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 131.505798 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 6.26 # mean distance (in host planet radii) + 131.50579 # daily motion (degrees) + 2.737522 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + + satellite Rhea { + rhea.jpg # texture file + 158,158,158 # color for untextured objects (RGB triplet) + 0.119944 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 79.660767 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 8.74 # mean distance (in host planet radii) + 79.660769 # daily motion (degrees) + 4.519163 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + + satellite Titan { + titan.jpg # texture file + 252,96,9 # color for untextured objects (RGB triplet) + 0.403732 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 22.546638 # rotation rate (in degrees/Earth day) + 0.0 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 20.27 # mean distance (in host planet radii) + 22.546639 # daily motion (degrees) + 15.966903 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } +} + + + + +planet Uranus { + uranus.jpg # texture file + 149,173,185 # color for untextured objects (RGB triplet) + 3.900000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 97.860001 # body tilt + 501.162415 # rotation rate (in degrees/Earth day) + 0.773430 # orbit tilt (relative to ecliptic) + 74.095402 # ascendind node (degrees) + 175.680703 # perihelion (degrees) + 19.301810 # mean distance (in AU) + 0.011623 # daily motion (degrees) + 30685.000000 # orbital period (Earth days) + 0.042896 # eccentricity + 303.189666 # mean longitude (degrees) + 7 # Index of custom function (0=NO) + + ring { + satrings.jpg # texture file + 150,150,150 # color if untextured + 5.0 # inner radius (in Earth radii) + 6.0 # outter radius (in Earth radii) + } +} + + + +planet Neptune { + neptune.jpg # texture file + 94,129,223 # color for untextured objects (RGB triplet) + 4.000000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 29.000000 # body tilt + 536.312866 # rotation rate (in degrees/Earth day) + 1.768100 # orbit tilt (relative to ecliptic) + 131.792503 # ascendind node (degrees) + 7.206000 # perihelion (degrees) + 30.266640 # mean distance (in AU) + 0.005919 # daily motion (degrees) + 60188.000000 # orbital period (Earth days) + 0.010298 # eccentricity + 299.864101 # mean longitude (degrees) + 8 # Index of custom function (0=NO) + + satellite Triton { + triton.jpg # texture file + 216,208,206 # color for untextured objects (RGB triplet) + 0.212135 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 61.257263 # rotation rate (in degrees/Earth day) + 156.999999 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 14.83 # mean distance (in host planet radii) + 61.257265 # daily motion (degrees) + 5.876854 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + +} + + +planet Pluto { + pluto.jpg # texture file + 241,220,167 # color for untextured objects (RGB triplet) + 0.450000 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 118.000000 # body tilt + 56.362724 # rotation rate (in degrees/Earth day) + 17.121370 # orbit tilt (relative to ecliptic) + 110.383302 # ascendind node (degrees) + 224.802494 # perihelion (degrees) + 39.580400 # mean distance (in AU) + 0.003958 # daily motion (degrees) + 90700.0 # orbital period (Earth days) + 0.250127 # eccentricity + 235.765590 # mean longitude (degrees) + 9 # Index of custom function (0=NO) + + satellite Charon { + charon.jpg # texture file + 125,109,94 # color for untextured objects (RGB triplet) + 0.092976 # radius (in Earth radii) + 0.0 # x axis flattening + 0.0 # y axis flattening + 0.0 # z axis flattening + 0.0 # surface randomness + 0.0 # body tilt + 56.362286 # rotation rate (in degrees/Earth day) + 98.999999 # orbit tilt (relative to host planet plane) + 0.0 # ascendind node (degrees) + 0.0 # perihelion (degrees) + 17.0 # mean distance (in host planet radii) + 56.362284 # daily motion (degrees) + 6.387250 # orbital period (Earth days) + 0.0 # eccentricity + 0.0 # mean longitude (degrees) + 0 # Index of custom function (0=NO) + } + +} + diff --git a/ssystem.h b/ssystem.h new file mode 100644 index 0000000..9d7ad2e --- /dev/null +++ b/ssystem.h @@ -0,0 +1,151 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1998 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +#include +#include +#include +#ifndef PLANET +#include "cfgparse.tab.h" +#endif + + +#define NUMSTARS 3141 /* 3141 for full star catalog, decrease number for better + performance, first N brighter stars are used */ + +#define MAXBODIES 50 + +#ifndef PI +#define PI 3.14159265358979323846 +#define PIl 3.14159265358979323846L +#endif + +#define DATEOFELEMENTS 2450680.5 /* In Julian days */ + +/* Macros used to scale down distances/radii so we can reduce the + jerkiness effect in outter bodies */ +#define DFACTOR 1000.0 +#define RADIUSSCALE(x) ((x)*0.1/DFACTOR) +#define DISTCORRECTION(x) ((x)*149.0/DFACTOR) + +/* Need no comment ;-) */ +#define DEG2RAD(x) ((x)*PI/180.0) +#define RAD2DEG(x) ((x)*180.0/PI) +#define DISTANCE(x,y,z) sqrt((x)*(x)+(y)*(y)+(z)*(z)) +#define RANGE(n,l,h) ((n)>(h)?(h):((n)<(l)?(l):(n))) + +#ifndef WIN32 +#define error(s) fprintf(stderr,s) +#define scmp strcasecmp +#else +#define error(s) MessageBox(NULL,s,"ERROR", MB_OK); +#define scmp _stricmp +#endif + +extern GLfloat LightPos[4]; +extern GLfloat ambient[4]; +extern GLfloat White[4]; +extern GLfloat Black[4]; +extern int texture,smodel,lighting,drawstars; +extern int Stars,Ecliptic,red,polaris; +extern int ImgWidth, ImgHeight, width, height; +extern double days,timefactor; +extern char texturepath[100]; +extern int slices,stacks,NUMBODIES; +extern double camx, camy, camz, eyex, eyey, eyez, upx, upy, upz; +extern float fov,fps,sec,star_mag, speed,accel,oldaccel,d,zoom,aratio; +extern int frames,paused,cmode,currsource,currtarget; +extern int demomode,bench,help,plabels,slabels,init,openbitmap; +extern int fullscreen,info,realtime,trail,jpeg_quality,atmospheres; +extern char sbuf[100],game_string[20]; +extern int joyavailable,joyactive; + + + +typedef struct { + char Name[20]; + int Type,TrailEnabled; + int Sat,CustomFunction; + GLUquadricObj *Object; + GLubyte *Image; + GLuint Sphere,Trail,*textures,texnum,texwidth,texheight; + float DeltaRotation,Radius,xflat,yflat,zflat,Rotation,Degrees,OrbitalPeriod; + float Inclination,AscendingNode,Perihelion,MeanDistance,DailyMotion; + float Eccentricity,MeanLongitude,Color[4]; + double posx,posy,posz; +} planetdata; + +typedef struct { + char Name[20]; + double posx,posy,posz; + float magnitude,color[3]; + char type; +} stardata; + +extern planetdata planets[MAXBODIES]; +extern stardata stars[NUMSTARS]; + + /* cmdline.c */ +#ifdef WIN32 +void ParseCmdLineWIN32(char *); +#else +void ParseCmdLine(int, char **); +#endif + /* init.c */ +void Init(void); +void InitStars(float, int); + /* positions.c */ +void UpdatePositions(double, int); + /* joystick.c */ +void joystick(void); +void joydetect(void); + /* cfgparse */ +void ReadConfigFile(void); + /* vsop87.c */ +void EarthPos(double, double *, double *, double *); +void JupiterPos(double, double *, double *, double *); +void MarsPos(double, double *, double *, double *); +void MercuryPos(double, double *, double *, double *); +void NeptunePos(double, double *, double *, double *); +void SaturnPos(double, double *, double *, double *); +void UranusPos(double, double *, double *, double *); +void VenusPos(double, double *, double *, double *); +void PlutoPos(double, double *, double *, double *); +void MoonPos(double, double *, double *, double *); + /* keyboard.c */ +void Key( unsigned char, int, int); +void Special(int, int, int); + /* mouse.c */ +void Mouse(int, int, int, int); +void Motion(int, int); + /* sshot.c */ +void ScreenShot(char *); + /* sun.c */ +void SunBillBoard( void ); + /* timer.c */ +void TimerDemo(int); + /* util.c */ +void printstring(void *, char *); +float gettime(void); +void Rotation(double, double, double, double, double *, double *, double *); + /* jpeg.c */ +GLubyte *read_JPEG_file (char *, int *, int *, int *); + /* stars.c */ +void InitStars(float, int); +extern float star_size; \ No newline at end of file diff --git a/ssystem.ico b/ssystem.ico new file mode 100644 index 0000000..0468b7b Binary files /dev/null and b/ssystem.ico differ diff --git a/ssystem.rc b/ssystem.rc new file mode 100644 index 0000000..699cbc0 --- /dev/null +++ b/ssystem.rc @@ -0,0 +1 @@ +GLUT_ICON ICON DISCARDABLE "ssystem.ico" diff --git a/stars.c b/stars.c new file mode 100644 index 0000000..cc1b747 --- /dev/null +++ b/stars.c @@ -0,0 +1,160 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ssystem.h" + +float star_size=0.3; + +void InitStars(float magcorr, int read_file) +{ + static char line[100],*tmp; + FILE *f=NULL; + static float ascention,declination,old_mag,magnitude; + static double a,b,x[4],y[4],z[4]; + int i,j; + + if (read_file) { + sprintf(line,"%s/stars.dat",texturepath); + f=fopen(line,"rt"); + if (f==NULL) { + error("Couldn't find star catalog file"); + exit(-1); + } + } + for (i=0;i1.0) magnitude=1.0; + + /* Only 20 magnitudes levels to speed up rendering process */ + magnitude=(int)ceil(magnitude*20.0)/20.0; + switch (stars[i].type) { + case 'O':stars[i].color[0]=0.8; + stars[i].color[1]=0.8; + stars[i].color[2]=1.0; + break; + case 'B':stars[i].color[0]=0.9; + stars[i].color[1]=0.9; + stars[i].color[2]=1.0; + break; + case 'A':stars[i].color[0]=1.0; + stars[i].color[1]=1.0; + stars[i].color[2]=1.0; + break; + case 'F':stars[i].color[0]=1.0; + stars[i].color[1]=1.0; + stars[i].color[2]=0.8; + break; + case 'G':stars[i].color[0]=1.0; + stars[i].color[1]=1.0; + stars[i].color[2]=0.7; + break; + case 'K':stars[i].color[0]=1.0; + stars[i].color[1]=0.9; + stars[i].color[2]=0.8; + break; + case 'M': + case 'C': + case 'S':stars[i].color[0]=1.0; + stars[i].color[1]=0.6; + stars[i].color[2]=0.6; + break; + } + stars[i].color[0]*=magnitude; + stars[i].color[1]*=magnitude; + stars[i].color[2]*=magnitude; + } + if (read_file) fclose(f); + + + old_mag=100.0; + i=0; + Stars = glGenLists(1); + glNewList( Stars, GL_COMPILE ); + glEnable(GL_BLEND); + while (stars[i].magnitude + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ssystem.h" + +void SunBillBoard( void ) +{ + double x[4],y[4],z[4]; + double alfa,beta; + int i; + +#define SIZE RADIUSSCALE(109.0) + + x[0]=x[3]=y[0]=y[1]=SIZE; + x[1]=x[2]=y[2]=y[3]=-SIZE; + z[0]=z[1]=z[2]=z[3]=0.0; + +/* BILLBOARDING effect, rotates sun tile so it shows always the same face and + angle to camera */ + alfa=atan2(camz,camx)-PI/2.0; + beta=atan2(camy,sqrt(camx*camx+camz*camz)); + for (i=0;i<4;i++) { + Rotation(beta,1.0,0.0,0.0,&x[i],&y[i],&z[i]); + Rotation(alfa,0.0,1.0,0.0,&x[i],&y[i],&z[i]); + } + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glBegin(GL_QUADS); + glTexCoord2f(0.0,0.0); glVertex3f(x[0],y[0],z[0]); + glTexCoord2f(0.0,1.0); glVertex3f(x[1],y[1],z[1]); + glTexCoord2f(1.0,1.0); glVertex3f(x[2],y[2],z[2]); + glTexCoord2f(1.0,0.0); glVertex3f(x[3],y[3],z[3]); + glEnd(); + glDisable(GL_BLEND); +} diff --git a/sun.jpg b/sun.jpg new file mode 100644 index 0000000..814a60d Binary files /dev/null and b/sun.jpg differ diff --git a/tethys.jpg b/tethys.jpg new file mode 100644 index 0000000..730c641 Binary files /dev/null and b/tethys.jpg differ diff --git a/timer.c b/timer.c new file mode 100644 index 0000000..feb0b19 --- /dev/null +++ b/timer.c @@ -0,0 +1,39 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ssystem.h" + + +void TimerDemo(int i) +{ + + if (demomode && cmode) { + cmode=(rand()%3)+1; + do { + currtarget=rand()%NUMBODIES; + currsource=rand()%NUMBODIES; + } while ((currsource==currtarget) || (planets[currsource].Type>=RING) + || (planets[currtarget].Type>=RING)); + zoom=rand()%50+5.0; + if (cmode==1) { /* Linked camera */ + Key('n',0,0); + } + } + glutTimerFunc(10000,TimerDemo,0); +} diff --git a/titan.jpg b/titan.jpg new file mode 100644 index 0000000..15afe38 Binary files /dev/null and b/titan.jpg differ diff --git a/triton.jpg b/triton.jpg new file mode 100644 index 0000000..3486170 Binary files /dev/null and b/triton.jpg differ diff --git a/uranus.jpg b/uranus.jpg new file mode 100644 index 0000000..c895831 Binary files /dev/null and b/uranus.jpg differ diff --git a/util.c b/util.c new file mode 100644 index 0000000..dee8853 --- /dev/null +++ b/util.c @@ -0,0 +1,88 @@ +/* + ssystem 1.6 + Copyright (C) 1997-1999 Raul Alonso + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ssystem.h" + +/* A couple of functions borrowed from David Bucciarelli's demos */ +void printstring(void *font, char *string) +{ + int i=0; + + while (string[i]) + glutBitmapCharacter(font,string[i++]); +} + +float gettime(void) +{ + static float told=0.0f; + float tnew,ris; + + tnew=glutGet(GLUT_ELAPSED_TIME); + + ris=tnew-told; + + told=tnew; + + return ris/1000.0; +} + +/* Rotates (rx,ry,rz) point about the (ax,ay,az) axis 'angle' radians, + borrowed from Mesa */ +void Rotation( double angle, double ax, double ay, double az, + double *rx, double *ry, double *rz) +{ + double mag, s, c; + double x,y,z,xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c; + + s = sin(angle); + c = cos(angle); + + mag = DISTANCE(ax,ay,az); + + if (mag == 0.0) return; + + x = ax/mag; + y = ay/mag; + z = az/mag; + + xx = x * x; + yy = y * y; + zz = z * z; + xy = x * y; + yz = y * z; + zx = z * x; + xs = x * s; + ys = y * s; + zs = z * s; + one_c = 1.0 - c; + + x = *rx*((one_c * xx) + c); + y = *rx*((one_c * xy) - zs); + z = *rx*((one_c * zx) + ys); + + x += *ry*((one_c * xy) + zs); + y += *ry*((one_c * yy) + c); + z += *ry*((one_c * yz) - xs); + + x += *rz*((one_c * zx) - ys); + y += *rz*((one_c * yz) + xs); + z += *rz*((one_c * zz) + c); + + *rx=x; *ry=y; *rz=z; +} diff --git a/venus.jpg b/venus.jpg new file mode 100644 index 0000000..111c23a Binary files /dev/null and b/venus.jpg differ diff --git a/vsop87.dat b/vsop87.dat new file mode 100644 index 0000000..d0980ed --- /dev/null +++ b/vsop87.dat @@ -0,0 +1,2805 @@ +double mercuryL0[]={38.0 +,440250710.0 ,0.0 ,0.0 +,40989415.0 ,1.48302034 ,26087.90314157 +,5046294.0 ,4.4778549 ,52175.8062831 +,855347.0 ,1.165203 ,78263.709425 +,165590.0 ,4.119692 ,104351.612566 +,34562.0 ,0.77931 ,130439.51571 +,7583.0 ,3.7135 ,156527.4188 +,3560.0 ,1.512 ,1109.3786 +,1803.0 ,4.1033 ,5661.332 +,1726.0 ,0.3583 ,182615.322 +,1590.0 ,2.9951 ,25028.5212 +,1365.0 ,4.5992 ,27197.2817 +,1017.0 ,0.8803 ,31749.2352 +,714.0 ,1.541 ,24978.525 +,644.0 ,5.303 ,21535.95 +,451.0 ,6.05 ,51116.424 +,404.0 ,3.282 ,208703.225 +,352.0 ,5.242 ,20426.571 +,345.0 ,2.792 ,15874.618 +,343.0 ,5.765 ,955.6 +,339.0 ,5.863 ,25558.212 +,325.0 ,1.337 ,53285.185 +,273.0 ,2.495 ,529.691 +,264.0 ,3.917 ,57837.138 +,260.0 ,0.987 ,4551.953 +,239.0 ,0.113 ,1059.382 +,235.0 ,0.267 ,11322.664 +,217.0 ,0.66 ,13521.751 +,209.0 ,2.092 ,47623.853 +,183.0 ,2.629 ,27043.503 +,182.0 ,2.434 ,25661.305 +,176.0 ,4.536 ,51066.428 +,173.0 ,2.452 ,24498.83 +,142.0 ,3.36 ,37410.567 +,138.0 ,0.291 ,10213.286 +,125.0 ,3.721 ,39609.655 +,118.0 ,2.781 ,77204.327 +,106.0 ,4.206 ,19804.827 +}; + +double mercuryL1[]={16.0 +,2608814706223.0 ,0.0 ,0.0 +,1126008.0 ,6.2170397 ,26087.9031416 +,303471.0 ,3.055655 ,52175.806283 +,80538.0 ,6.10455 ,78263.70942 +,21245.0 ,2.83532 ,104351.61257 +,5592.0 ,5.8268 ,130439.5157 +,1472.0 ,2.5185 ,156527.4188 +,388.0 ,5.48 ,182615.322 +,352.0 ,3.052 ,1109.379 +,103.0 ,2.149 ,208703.225 +,94.0 ,6.12 ,27197.28 +,91.0 ,0.0 ,24978.52 +,52.0 ,5.62 ,5661.33 +,44.0 ,4.57 ,25028.52 +,28.0 ,3.04 ,51066.43 +,27.0 ,5.09 ,234791.13 +}; + +double mercuryL2[]={10.0 +,53050.0 ,0.0 ,0.0 +,16904.0 ,4.69072 ,26087.90314 +,7397.0 ,1.3474 ,52175.8063 +,3018.0 ,4.4564 ,78263.7094 +,1107.0 ,1.2623 ,104351.6126 +,378.0 ,4.32 ,130439.516 +,123.0 ,1.069 ,156527.419 +,39.0 ,4.08 ,182615.32 +,15.0 ,4.63 ,1109.38 +,12.0 ,0.79 ,208703.23 +}; + +double mercuryL3[]={8.0 +,188.0 ,0.035 ,52175.806 +,142.0 ,3.125 ,26087.903 +,97.0 ,3 ,78263.71 +,44.0 ,6.02 ,104351.61 +,35.0 ,0.0 ,0.0 +,18.0 ,2.78 ,130439.52 +,7.0 ,5.82 ,156527.42 +,3.0 ,2.57 ,182615.32 +}; + +double mercuryL4[]={6.0 +,114.0 ,3.1416 ,0.0 +,3.0 ,2.03 ,26087.9 +,2.0 ,1.42 ,78263.71 +,2.0 ,4.5 ,52175.81 +,1.0 ,4.5 ,104351.61 +,1.0 ,1.27 ,130439.52 +}; + +double mercuryL5[]={1.0 +,1.0 ,3.14 ,0.0 +}; + +double mercuryB0[]={14.0 +,11737529.0 ,1.98357499 ,26087.90314157 +,2388077.0 ,5.0373896 ,52175.8062831 +,1222840.0 ,3.1415927 ,0.0 +,543252.0 ,1.796444 ,78263.709425 +,129779.0 ,4.832325 ,104351.612566 +,31867.0 ,1.58088 ,130439.51571 +,7963.0 ,4.6097 ,156527.4188 +,2014.0 ,1.3532 ,182615.322 +,514.0 ,4.378 ,208703.225 +,209.0 ,2.02 ,24978.525 +,208.0 ,4.918 ,27197.282 +,132.0 ,1.119 ,234791.128 +,121.0 ,1.813 ,53285.185 +,100.0 ,5.657 ,20426.571 +}; + +double mercuryB1[]={11.0 +,429151.0 ,3.501698 ,26087.903142 +,146234.0 ,3.141593 ,0.0 +,22675.0 ,0.01515 ,52175.80628 +,10895.0 ,0.4854 ,78263.70942 +,6353.0 ,3.4294 ,104351.6126 +,2496.0 ,0.1605 ,130439.5157 +,860.0 ,3.185 ,156527.419 +,278.0 ,6.21 ,182615.322 +,86.0 ,2.95 ,208703.23 +,28.0 ,0.29 ,27197.28 +,26.0 ,5.98 ,234791.13 +}; + +double mercuryB2[]={9.0 +,11831.0 ,4.79066 ,26087.90314 +,1914.0 ,0.0 ,0.0 +,1045.0 ,1.2122 ,52175.8063 +,266.0 ,4.434 ,78263.709 +,170.0 ,1.623 ,104351.613 +,96.0 ,4.8 ,130439.52 +,45.0 ,1.61 ,156527.42 +,18.0 ,4.67 ,182615.32 +,7.0 ,1.43 ,208703.23 +}; + +double mercuryB3[]={7.0 +,235.0 ,0.354 ,26087.903 +,161.0 ,0.0 ,0.0 +,19.0 ,4.36 ,52175.81 +,6.0 ,2.51 ,78263.71 +,5.0 ,6.14 ,104351.61 +,3.0 ,3.12 ,130439.52 +,2.0 ,6.27 ,156527.42 +}; + +double mercuryB4[]={2.0 +,4.0 ,1.75 ,26087.9 +,1.0 ,3.14 ,0.0 +}; + +double mercuryR0[]={13.0 +,39528272.0 ,0.0 ,0.0 +,7834132.0 ,6.1923372 ,26087.9031416 +,795526.0 ,2.959897 ,52175.806283 +,121282.0 ,6.010642 ,78263.709425 +,21922.0 ,2.7782 ,104351.61257 +,4354.0 ,5.8289 ,130439.5157 +,918.0 ,2.597 ,156527.419 +,290.0 ,1.424 ,25028.521 +,260.0 ,3.028 ,27197.282 +,202.0 ,5.647 ,182615.322 +,201.0 ,5.592 ,31749.235 +,142.0 ,6.253 ,24978.525 +,100.0 ,3.734 ,21535.95 +}; + +double mercuryR1[]={8.0 +,217348.0 ,4.656172 ,26087.903142 +,44142.0 ,1.42386 ,52175.80628 +,10094.0 ,4.47466 ,78263.70942 +,2433.0 ,1.2423 ,104351.6126 +,1624.0 ,0.0 ,0.0 +,604.0 ,4.293 ,130439.516 +,153.0 ,1.061 ,156527.419 +,39.0 ,4.11 ,182615.32 +}; + +double mercuryR2[]={7.0 +,3118.0 ,3.0823 ,26087.9031 +,1245.0 ,6.1518 ,52175.8063 +,425.0 ,2.926 ,78263.709 +,136.0 ,5.98 ,104351.613 +,42.0 ,2.75 ,130439.52 +,22.0 ,3.14 ,0.0 +,13.0 ,5.8 ,156527.42 +}; + +double mercuryR3[]={5.0 +,33.0 ,1.68 ,26087.9 +,24.0 ,4.63 ,52175.81 +,12.0 ,1.39 ,78263.71 +,5.0 ,4.44 ,104351.61 +,2.0 ,1.21 ,130439.52 +}; + +double venusL0[]={24.0 +,317614667.0 ,0.0 ,0.0 +,1353968.0 ,5.5931332 ,10213.2855462 +,89892.0 ,5.3065 ,20426.57109 +,5477.0 ,4.4163 ,7860.4194 +,3456.0 ,2.6996 ,11790.6291 +,2372.0 ,2.9938 ,3930.2097 +,1664.0 ,4.2502 ,1577.3435 +,1438.0 ,4.1575 ,9683.5946 +,1317.0 ,5.1867 ,26.2983 +,1201.0 ,6.1536 ,30639.8566 +,769.0 ,0.816 ,9437.763 +,761.0 ,1.95 ,529.691 +,708.0 ,1.065 ,775.523 +,585.0 ,3.998 ,191.448 +,500.0 ,4.123 ,15720.839 +,429.0 ,3.586 ,19367.189 +,327.0 ,5.677 ,5507.553 +,326.0 ,4.591 ,10404.734 +,232.0 ,3.163 ,9153.904 +,180.0 ,4.653 ,1109.379 +,155.0 ,5.57 ,19651.048 +,128.0 ,4.226 ,20.775 +,128.0 ,0.962 ,5661.332 +,106.0 ,1.537 ,801.821 +}; + +double venusL1[]={12.0 +,1021352943053.0 ,0.0 ,0.0 +,95708.0 ,2.46424 ,10213.28555 +,14445.0 ,0.51625 ,20426.57109 +,213.0 ,1.795 ,30639.857 +,174.0 ,2.655 ,26.298 +,152.0 ,6.106 ,1577.344 +,82.0 ,5.7 ,191.45 +,70.0 ,2.68 ,9437.76 +,52.0 ,3.6 ,775.52 +,38.0 ,1.03 ,529.69 +,30.0 ,1.25 ,5507.55 +,25.0 ,6.11 ,10404.73 +}; + +double venusL2[]={8.0 +,54127.0 ,0.0 ,0.0 +,3891.0 ,0.3451 ,10213.2855 +,1338.0 ,2.0201 ,20426.5711 +,24.0 ,2.05 ,26.3 +,19.0 ,3.54 ,30639.86 +,10.0 ,3.97 ,775.52 +,7.0 ,1.52 ,1577.34 +,6.0 ,1 ,191.45 +}; + +double venusL3[]={3.0 +,136.0 ,4.804 ,10213.286 +,78.0 ,3.67 ,20426.57 +,26.0 ,0.0 ,0.0 +}; + +double venusL4[]={3.0 +,114.0 ,3.1416 ,0.0 +,3.0 ,5.21 ,20426.57 +,2.0 ,2.51 ,10213.29 +}; + +double venusL5[]={1.0 +,1.0 ,3.14 ,0.0 +}; + +double venusB0[]={9.0 +,5923638.0 ,0.2670278 ,10213.2855462 +,40108.0 ,1.14737 ,20426.57109 +,32815.0 ,3.14159 ,0.0 +,1011.0 ,1.0895 ,30639.8566 +,149.0 ,6.254 ,18073.705 +,138.0 ,0.86 ,1577.344 +,130.0 ,3.672 ,9437.763 +,120.0 ,3.705 ,2352.866 +,108.0 ,4.539 ,22003.915 +}; + +double venusB1[]={4.0 +,513348.0 ,1.803643 ,10213.285546 +,4380.0 ,3.3862 ,20426.5711 +,199.0 ,0.0 ,0.0 +,197.0 ,2.53 ,30639.857 +}; + +double venusB2[]={4.0 +,22378.0 ,3.38509 ,10213.28555 +,282.0 ,0.0 ,0.0 +,173.0 ,5.256 ,20426.571 +,27.0 ,3.87 ,30639.86 +}; + +double venusB3[]={4.0 +,647.0 ,4.992 ,10213.286 +,20.0 ,3.14 ,0.0 +,6.0 ,0.77 ,20426.57 +,3.0 ,5.44 ,30639.86 +}; + +double venusB4[]={1.0 +,14.0 ,0.32 ,10213.29 +}; + +double venusR0[]={12.0 +,72334821.0 ,0.0 ,0.0 +,489824.0 ,4.021518 ,10213.285546 +,1658.0 ,4.9021 ,20426.5711 +,1632.0 ,2.8455 ,7860.4194 +,1378.0 ,1.1285 ,11790.6291 +,498.0 ,2.587 ,9683.595 +,374.0 ,1.423 ,3930.21 +,264.0 ,5.529 ,9437.763 +,237.0 ,2.551 ,15720.839 +,222.0 ,2.013 ,19367.189 +,126.0 ,2.728 ,1577.344 +,119.0 ,3.02 ,10404.734 +}; + +double venusR1[]={3.0 +,34551.0 ,0.89199 ,10213.28555 +,234.0 ,1.772 ,20426.571 +,234.0 ,3.142 ,0.0 +}; + +double venusR2[]={3.0 +,1407.0 ,5.0637 ,10213.2855 +,16.0 ,5.47 ,20426.57 +,13.0 ,0.0 ,0.0 +}; + +double venusR3[]={1.0 +,50.0 ,3.22 ,10213.29 +}; + +double venusR4[]={1.0 +,1.0 ,0.92 ,10213.29 +}; + +double earthL0[]={64.0 +,175347046.0 ,0.0 ,0.0 +,3341656.0 ,4.6692568 ,6283.07585 +,34894.0 ,4.6261 ,12566.1517 +,3497.0 ,2.7441 ,5753.3849 +,3418.0 ,2.8289 ,3.5231 +,3136.0 ,3.6277 ,77713.7715 +,2676.0 ,4.4181 ,7860.4194 +,2343.0 ,6.1352 ,3930.2097 +,1324.0 ,0.7425 ,11506.7698 +,1273.0 ,2.0371 ,529.691 +,1199.0 ,1.1096 ,1577.3435 +,990.0 ,5.233 ,5884.927 +,902.0 ,2.045 ,26.298 +,857.0 ,3.508 ,398.149 +,780.0 ,1.179 ,5223.694 +,753.0 ,2.533 ,5507.553 +,505.0 ,4.583 ,18849.228 +,492.0 ,4.205 ,775.523 +,357.0 ,2.92 ,0.067 +,317.0 ,5.849 ,11790.629 +,284.0 ,1.899 ,796.298 +,271.0 ,0.315 ,10977.079 +,243.0 ,0.345 ,5486.778 +,206.0 ,4.806 ,2544.314 +,205.0 ,1.869 ,5573.143 +,202.0 ,2.458 ,6069.777 +,156.0 ,0.833 ,213.299 +,132.0 ,3.411 ,2942.463 +,126.0 ,1.083 ,20.775 +,115.0 ,0.645 ,0.98 +,103.0 ,0.636 ,4694.003 +,102.0 ,0.976 ,15720.839 +,102.0 ,4.267 ,7.114 +,99.0 ,6.21 ,2146.17 +,98.0 ,0.68 ,155.42 +,86.0 ,5.98 ,161000.69 +,85.0 ,1.3 ,6275.96 +,85.0 ,3.67 ,71430.7 +,80.0 ,1.81 ,17260.15 +,79.0 ,3.04 ,12036.46 +,75.0 ,1.76 ,5088.63 +,74.0 ,3.5 ,3154.69 +,74.0 ,4.68 ,801.82 +,70.0 ,0.83 ,9437.76 +,62.0 ,3.98 ,8827.39 +,61.0 ,1.82 ,7084.9 +,57.0 ,2.78 ,6286.6 +,56.0 ,4.39 ,14143.5 +,56.0 ,3.47 ,6279.55 +,52.0 ,0.19 ,12139.55 +,52.0 ,1.33 ,1748.02 +,51.0 ,0.28 ,5856.48 +,49.0 ,0.49 ,1194.45 +,41.0 ,5.37 ,8429.24 +,41.0 ,2.4 ,19651.05 +,39.0 ,6.17 ,10447.39 +,37.0 ,6.04 ,10213.29 +,37.0 ,2.57 ,1059.38 +,36.0 ,1.71 ,2352.87 +,36.0 ,1.78 ,6812.77 +,33.0 ,0.59 ,17789.85 +,30.0 ,0.44 ,83996.85 +,30.0 ,2.74 ,1349.87 +,25.0 ,3.16 ,4690.48 +}; + +double earthL1[]={34.0 +,628331966747.0 ,0.0 ,0.0 +,206059.0 ,2.678235 ,6283.07585 +,4303.0 ,2.6351 ,12566.1517 +,425.0 ,1.59 ,3.523 +,119.0 ,5.796 ,26.298 +,109.0 ,2.966 ,1577.344 +,93.0 ,2.59 ,18849.23 +,72.0 ,1.14 ,529.69 +,68.0 ,1.87 ,398.15 +,67.0 ,4.41 ,5507.55 +,59.0 ,2.89 ,5223.69 +,56.0 ,2.17 ,155.42 +,45.0 ,0.4 ,796.3 +,36.0 ,0.47 ,775.52 +,29.0 ,2.65 ,7.11 +,21.0 ,5.34 ,0.98 +,19.0 ,1.85 ,5486.78 +,19.0 ,4.97 ,213.3 +,17.0 ,2.99 ,6275.96 +,16.0 ,0.03 ,2544.31 +,16.0 ,1.43 ,2146.17 +,15.0 ,1.21 ,10977.08 +,12.0 ,2.83 ,1748.02 +,12.0 ,3.26 ,5088.63 +,12.0 ,5.27 ,1194.45 +,12.0 ,2.08 ,4694 +,11.0 ,0.77 ,553.57 +,10.0 ,1.3 ,6286.6 +,10.0 ,4.24 ,1349.87 +,9.0 ,2.7 ,242.73 +,9.0 ,5.64 ,951.72 +,8.0 ,5.3 ,2352.87 +,6.0 ,2.65 ,9437.76 +,6.0 ,4.67 ,4690.48 +}; + +double earthL2[]={20.0 +,52919.0 ,0.0 ,0.0 +,8720.0 ,1.0721 ,6283.0758 +,309.0 ,0.867 ,12566.152 +,27.0 ,0.05 ,3.52 +,16.0 ,5.19 ,26.3 +,16.0 ,3.68 ,155.42 +,10.0 ,0.76 ,18849.23 +,9.0 ,2.06 ,77713.77 +,7.0 ,0.83 ,775.52 +,5.0 ,4.66 ,1577.34 +,4.0 ,1.03 ,7.11 +,4.0 ,3.44 ,5573.14 +,3.0 ,5.14 ,796.3 +,3.0 ,6.05 ,5507.55 +,3.0 ,1.19 ,242.73 +,3.0 ,6.12 ,529.69 +,3.0 ,0.31 ,398.15 +,3.0 ,2.28 ,553.57 +,2.0 ,4.38 ,5223.69 +,2.0 ,3.75 ,0.98 +}; + +double earthL3[]={7.0 +,289.0 ,5.844 ,6283.076 +,35.0 ,0.0 ,0.0 +,17.0 ,5.49 ,12566.15 +,3.0 ,5.2 ,155.42 +,1.0 ,4.72 ,3.52 +,1.0 ,5.3 ,18849.23 +,1.0 ,5.97 ,242.73 +}; + +double earthL4[]={3.0 +,114.0 ,3.142 ,0.0 +,8.0 ,4.13 ,6283.08 +,1.0 ,3.84 ,12566.15 +}; + +double earthL5[]={1.0 +,1.0 ,3.14 ,0.0 +}; + +double earthB0[]={5.0 +,280.0 ,3.199 ,84334.662 +,102.0 ,5.422 ,5507.553 +,80.0 ,3.88 ,5223.69 +,44.0 ,3.7 ,2352.87 +,32.0 ,4 ,1577.34 +}; + +double earthB1[]={2.0 +,9.0 ,3.9 ,5507.55 +,6.0 ,1.73 ,5223.69 +}; + +double earthR0[]={40.0 +,100013989.0 ,0.0 ,0.0 +,1670700.0 ,3.0984635 ,6283.07585 +,13956.0 ,3.05525 ,12566.1517 +,3084.0 ,5.1985 ,77713.7715 +,1628.0 ,1.1739 ,5753.3849 +,1576.0 ,2.8469 ,7860.4194 +,925.0 ,5.453 ,11506.77 +,542.0 ,4.564 ,3930.21 +,472.0 ,3.661 ,5884.927 +,346.0 ,0.964 ,5507.553 +,329.0 ,5.9 ,5223.694 +,307.0 ,0.299 ,5573.143 +,243.0 ,4.273 ,11790.629 +,212.0 ,5.847 ,1577.344 +,186.0 ,5.022 ,10977.079 +,175.0 ,3.012 ,18849.228 +,110.0 ,5.055 ,5486.778 +,98.0 ,0.89 ,6069.78 +,86.0 ,5.69 ,15720.84 +,86.0 ,1.27 ,161000.69 +,65.0 ,0.27 ,17260.15 +,63.0 ,0.92 ,529.69 +,57.0 ,2.01 ,83996.85 +,56.0 ,5.24 ,71430.7 +,49.0 ,3.25 ,2544.31 +,47.0 ,2.58 ,775.52 +,45.0 ,5.54 ,9437.76 +,43.0 ,6.01 ,6275.96 +,39.0 ,5.36 ,4694 +,38.0 ,2.39 ,8827.39 +,37.0 ,0.83 ,19651.05 +,37.0 ,4.9 ,12139.55 +,36.0 ,1.67 ,12036.46 +,35.0 ,1.84 ,2942.46 +,33.0 ,0.24 ,7084.9 +,32.0 ,0.18 ,5088.63 +,32.0 ,1.78 ,398.15 +,28.0 ,1.21 ,6286.6 +,28.0 ,1.9 ,6279.55 +,26.0 ,4.59 ,10447.39 +}; + +double earthR1[]={10.0 +,103019.0 ,1.10749 ,6283.07585 +,1721.0 ,1.0644 ,12566.1517 +,702.0 ,3.142 ,0.0 +,32.0 ,1.02 ,18849.23 +,31.0 ,2.84 ,5507.55 +,25.0 ,1.32 ,5223.69 +,18.0 ,1.42 ,1577.34 +,10.0 ,5.91 ,10977.08 +,9.0 ,1.42 ,6275.96 +,9.0 ,0.27 ,5486.78 +}; + +double earthR2[]={6.0 +,4359.0 ,5.7846 ,6283.0758 +,124.0 ,5.579 ,12566.152 +,12.0 ,3.14 ,0.0 +,9.0 ,3.63 ,77713.77 +,6.0 ,1.87 ,5573.14 +,3.0 ,5.47 ,18849.23 +}; + +double earthR3[]={2.0 +,145.0 ,4.273 ,6283.076 +,7.0 ,3.92 ,12566.15 +}; + +double earthR4[]={1.0 +,4.0 ,2.56 ,6283.08 +}; + +double marsL0[]={69.0 +,620347712.0 ,0.0 ,0.0 +,18656368.0 ,5.050371 ,3340.6124267 +,1108217.0 ,5.4009984 ,6681.2248534 +,91798.0 ,5.75479 ,10021.83728 +,27745.0 ,5.9705 ,3.52312 +,12316.0 ,0.84956 ,2810.92146 +,10610.0 ,2.93959 ,2281.2305 +,8927.0 ,4.157 ,0.0173 +,8716.0 ,6.1101 ,13362.4497 +,7775.0 ,3.3397 ,5621.8429 +,6798.0 ,0.3646 ,398.149 +,4161.0 ,0.2281 ,2942.4634 +,3575.0 ,1.6619 ,2544.3144 +,3075.0 ,0.857 ,191.4483 +,2938.0 ,6.0789 ,0.0673 +,2628.0 ,0.6481 ,3337.0893 +,2580.0 ,0.03 ,3344.1355 +,2389.0 ,5.039 ,796.298 +,1799.0 ,0.6563 ,529.691 +,1546.0 ,2.9158 ,1751.5395 +,1528.0 ,1.1498 ,6151.5339 +,1286.0 ,3.068 ,2146.1654 +,1264.0 ,3.6228 ,5092.152 +,1025.0 ,3.6933 ,8962.4553 +,892.0 ,0.183 ,16703.062 +,859.0 ,2.401 ,2914.014 +,833.0 ,4.495 ,3340.63 +,833.0 ,2.464 ,3340.595 +,749.0 ,3.822 ,155.42 +,724.0 ,0.675 ,3738.761 +,713.0 ,3.663 ,1059.382 +,655.0 ,0.489 ,3127.313 +,636.0 ,2.922 ,8432.764 +,553.0 ,4.475 ,1748.016 +,550.0 ,3.81 ,0.98 +,472.0 ,3.625 ,1194.447 +,426.0 ,0.554 ,6283.076 +,415.0 ,0.497 ,213.299 +,312.0 ,0.999 ,6677.702 +,307.0 ,0.381 ,6684.748 +,302.0 ,4.486 ,3532.061 +,299.0 ,2.783 ,6254.627 +,293.0 ,4.221 ,20.775 +,284.0 ,5.769 ,3149.164 +,281.0 ,5.882 ,1349.867 +,274.0 ,0.542 ,3340.545 +,274.0 ,0.134 ,3340.68 +,239.0 ,5.372 ,4136.91 +,236.0 ,5.755 ,3333.499 +,231.0 ,1.282 ,3870.303 +,221.0 ,3.505 ,382.897 +,204.0 ,2.821 ,1221.849 +,193.0 ,3.357 ,3.59 +,189.0 ,1.491 ,9492.146 +,179.0 ,1.006 ,951.718 +,174.0 ,2.414 ,553.569 +,172.0 ,0.439 ,5486.778 +,160.0 ,3.949 ,4562.461 +,144.0 ,1.419 ,135.065 +,140.0 ,3.326 ,2700.715 +,138.0 ,4.301 ,7.114 +,131.0 ,4.045 ,12303.068 +,128.0 ,2.208 ,1592.596 +,128.0 ,1.807 ,5088.629 +,117.0 ,3.128 ,7903.073 +,113.0 ,3.701 ,1589.073 +,110.0 ,1.052 ,242.729 +,105.0 ,0.785 ,8827.39 +,100.0 ,3.243 ,11773.377 +}; + +double marsL1[]={46.0 +,334085627474.0 ,0.0 ,0.0 +,1458227.0 ,3.6042605 ,3340.6124267 +,164901.0 ,3.926313 ,6681.224853 +,19963.0 ,4.26594 ,10021.83728 +,3452.0 ,4.7321 ,3.5231 +,2485.0 ,4.6128 ,13362.4497 +,842.0 ,4.459 ,2281.23 +,538.0 ,5.016 ,398.149 +,521.0 ,4.994 ,3344.136 +,433.0 ,2.561 ,191.448 +,430.0 ,5.316 ,155.42 +,382.0 ,3.539 ,796.298 +,314.0 ,4.963 ,16703.062 +,283.0 ,3.16 ,2544.314 +,206.0 ,4.569 ,2146.165 +,169.0 ,1.329 ,3337.089 +,158.0 ,4.185 ,1751.54 +,134.0 ,2.233 ,0.98 +,134.0 ,5.974 ,1748.016 +,118.0 ,6.024 ,6151.534 +,117.0 ,2.213 ,1059.382 +,114.0 ,2.129 ,1194.447 +,114.0 ,5.428 ,3738.761 +,91.0 ,1.1 ,1349.87 +,85.0 ,3.91 ,553.57 +,83.0 ,5.3 ,6684.75 +,81.0 ,4.43 ,529.69 +,80.0 ,2.25 ,8962.46 +,73.0 ,2.5 ,951.72 +,73.0 ,5.84 ,242.73 +,71.0 ,3.86 ,2914.01 +,68.0 ,5.02 ,382.9 +,65.0 ,1.02 ,3340.6 +,65.0 ,3.05 ,3340.63 +,62.0 ,4.15 ,3149.16 +,57.0 ,3.89 ,4136.91 +,48.0 ,4.87 ,213.3 +,48.0 ,1.18 ,3333.5 +,47.0 ,1.31 ,3185.19 +,41.0 ,0.71 ,1592.6 +,40.0 ,2.73 ,7.11 +,40.0 ,5.32 ,20043.67 +,33.0 ,5.41 ,6283.08 +,28.0 ,0.05 ,9492.15 +,27.0 ,3.89 ,1221.85 +,27.0 ,5.11 ,2700.72 +}; + +double marsL2[]={33.0 +,58016.0 ,2.04979 ,3340.61243 +,54188.0 ,0.0 ,0.0 +,13908.0 ,2.45742 ,6681.22485 +,2465.0 ,2.8 ,10021.8373 +,398.0 ,3.141 ,13362.45 +,222.0 ,3.194 ,3.523 +,121.0 ,0.543 ,155.42 +,62.0 ,3.49 ,16703.06 +,54.0 ,3.54 ,3344.14 +,34.0 ,6 ,2281.23 +,32.0 ,4.14 ,191.45 +,30.0 ,2 ,796.3 +,23.0 ,4.33 ,242.73 +,22.0 ,3.45 ,398.15 +,20.0 ,5.42 ,553.57 +,16.0 ,0.66 ,0.98 +,16.0 ,6.11 ,2146.17 +,16.0 ,1.22 ,1748.02 +,15.0 ,6.1 ,3185.19 +,14.0 ,4.02 ,951.72 +,14.0 ,2.62 ,1349.87 +,13.0 ,0.6 ,1194.45 +,12.0 ,3.86 ,6684.75 +,11.0 ,4.72 ,2544.31 +,10.0 ,0.25 ,382.9 +,9.0 ,0.68 ,1059.38 +,9.0 ,3.83 ,20043.67 +,9.0 ,3.88 ,3738.76 +,8.0 ,5.46 ,1751.54 +,7.0 ,2.58 ,3149.16 +,7.0 ,2.38 ,4136.91 +,6.0 ,5.48 ,1592.6 +,6.0 ,2.34 ,3097.88 +}; + +double marsL3[]={12.0 +,1482.0 ,0.4443 ,3340.6124 +,662.0 ,0.885 ,6681.225 +,188.0 ,1.288 ,10021.837 +,41.0 ,1.65 ,13362.45 +,26.0 ,0.0 ,0.0 +,23.0 ,2.05 ,155.42 +,10.0 ,1.58 ,3.52 +,8.0 ,2 ,16703.06 +,5.0 ,2.82 ,242.73 +,4.0 ,2.02 ,3344.14 +,3.0 ,4.59 ,3185.19 +,3.0 ,0.65 ,553.57 +}; + +double marsL4[]={8.0 +,114.0 ,3.1416 ,0.0 +,29.0 ,5.64 ,6681.22 +,24.0 ,5.14 ,3340.61 +,11.0 ,6.03 ,10021.84 +,3.0 ,0.13 ,13362.45 +,3.0 ,3.56 ,155.42 +,1.0 ,0.49 ,16703.06 +,1.0 ,1.32 ,242.73 +}; + +double marsL5[]={2.0 +,1.0 ,3.14 ,0.0 +,1.0 ,4.04 ,6681.22 +}; + +double marsB0[]={16.0 +,3197135.0 ,3.7683204 ,3340.6124267 +,298033.0 ,4.10617 ,6681.224853 +,289105.0 ,0.0 ,0.0 +,31366.0 ,4.44651 ,10021.83728 +,3484.0 ,4.7881 ,13362.4497 +,443.0 ,5.026 ,3344.136 +,443.0 ,5.652 ,3337.089 +,399.0 ,5.131 ,16703.062 +,293.0 ,3.793 ,2281.23 +,182.0 ,6.136 ,6151.534 +,163.0 ,4.264 ,529.691 +,160.0 ,2.232 ,1059.382 +,149.0 ,2.165 ,5621.843 +,143.0 ,1.182 ,3340.595 +,143.0 ,3.213 ,3340.63 +,139.0 ,2.418 ,8962.455 +}; + +double marsB1[]={9.0 +,350069.0 ,5.368478 ,3340.612427 +,14116.0 ,3.14159 ,0.0 +,9671.0 ,5.4788 ,6681.2249 +,1472.0 ,3.2021 ,10021.8373 +,426.0 ,3.408 ,13362.45 +,102.0 ,0.776 ,3337.089 +,79.0 ,3.72 ,16703.06 +,33.0 ,3.46 ,5621.84 +,26.0 ,2.48 ,2281.23 +}; + +double marsB2[]={7.0 +,16727.0 ,0.60221 ,3340.61243 +,4987.0 ,3.1416 ,0.0 +,302.0 ,3.559 ,6681.225 +,26.0 ,1.9 ,13362.45 +,21.0 ,0.92 ,10021.84 +,12.0 ,2.24 ,3337.09 +,8.0 ,2.25 ,16703.06 +}; + +double marsB3[]={4.0 +,607.0 ,1.981 ,3340.612 +,43.0 ,0.0 ,0.0 +,14.0 ,1.8 ,6681.22 +,3.0 ,3.45 ,10021.84 +}; + +double marsB4[]={3.0 +,13.0 ,0.0 ,0.0 +,11.0 ,3.46 ,3340.61 +,1.0 ,0.5 ,6681.22 +}; + +double marsR0[]={45.0 +,153033488.0 ,0.0 ,0.0 +,14184953.0 ,3.47971284 ,3340.6124267 +,660776.0 ,3.817834 ,6681.224853 +,46179.0 ,4.15595 ,10021.83728 +,8110.0 ,5.5596 ,2810.9215 +,7485.0 ,1.7724 ,5621.8429 +,5523.0 ,1.3644 ,2281.2305 +,3825.0 ,4.4941 ,13362.4497 +,2484.0 ,4.9255 ,2942.4634 +,2307.0 ,0.0908 ,2544.3144 +,1999.0 ,5.3606 ,3337.0893 +,1960.0 ,4.7425 ,3344.1355 +,1167.0 ,2.1126 ,5092.152 +,1103.0 ,5.0091 ,398.149 +,992.0 ,5.839 ,6151.534 +,899.0 ,4.408 ,529.691 +,807.0 ,2.102 ,1059.382 +,798.0 ,3.448 ,796.298 +,741.0 ,1.499 ,2146.165 +,726.0 ,1.245 ,8432.764 +,692.0 ,2.134 ,8962.455 +,633.0 ,0.894 ,3340.595 +,633.0 ,2.924 ,3340.63 +,630.0 ,1.287 ,1751.54 +,574.0 ,0.829 ,2914.014 +,526.0 ,5.383 ,3738.761 +,473.0 ,5.199 ,3127.313 +,348.0 ,4.832 ,16703.062 +,284.0 ,2.907 ,3532.061 +,280.0 ,5.257 ,6283.076 +,276.0 ,1.218 ,6254.627 +,275.0 ,2.908 ,1748.016 +,270.0 ,3.764 ,5884.927 +,239.0 ,2.037 ,1194.447 +,234.0 ,5.105 ,5486.778 +,228.0 ,3.255 ,6872.673 +,223.0 ,4.199 ,3149.164 +,219.0 ,5.583 ,191.448 +,208.0 ,5.255 ,3340.545 +,208.0 ,4.846 ,3340.68 +,186.0 ,5.699 ,6677.702 +,183.0 ,5.081 ,6684.748 +,179.0 ,4.184 ,3333.499 +,176.0 ,5.953 ,3870.303 +,164.0 ,3.799 ,4136.91 +}; + +double marsR1[]={27.0 +,1107433.0 ,2.0325052 ,3340.6124267 +,103176.0 ,2.370718 ,6681.224853 +,12877.0 ,0.0 ,0.0 +,10816.0 ,2.70888 ,10021.83728 +,1195.0 ,3.047 ,13362.4497 +,439.0 ,2.888 ,2281.23 +,396.0 ,3.423 ,3344.136 +,183.0 ,1.584 ,2544.314 +,136.0 ,3.385 ,16703.062 +,128.0 ,6.043 ,3337.089 +,128.0 ,0.63 ,1059.382 +,127.0 ,1.954 ,796.298 +,118.0 ,2.998 ,2146.165 +,88.0 ,3.42 ,398.15 +,83.0 ,3.86 ,3738.76 +,76.0 ,4.45 ,6151.53 +,72.0 ,2.76 ,529.69 +,67.0 ,2.55 ,1751.54 +,66.0 ,4.41 ,1748.02 +,58.0 ,0.54 ,1194.45 +,54.0 ,0.68 ,8962.46 +,51.0 ,3.73 ,6684.75 +,49.0 ,5.73 ,3340.6 +,49.0 ,1.48 ,3340.63 +,48.0 ,2.58 ,3149.16 +,48.0 ,2.29 ,2914.01 +,39.0 ,2.32 ,4136.91 +}; + +double marsR2[]={11.0 +,44242.0 ,0.47931 ,3340.61243 +,8138.0 ,0.87 ,6681.2249 +,1275.0 ,1.2259 ,10021.8373 +,187.0 ,1.573 ,13362.45 +,52.0 ,3.14 ,0.0 +,41.0 ,1.97 ,3344.14 +,27.0 ,1.92 ,16703.06 +,18.0 ,4.43 ,2281.23 +,12.0 ,4.53 ,3185.19 +,10.0 ,5.39 ,1059.38 +,10.0 ,0.42 ,796.3 +}; + +double marsR3[]={6.0 +,1113.0 ,5.1499 ,3340.6124 +,424.0 ,5.613 ,6681.225 +,100.0 ,5.997 ,10021.837 +,20.0 ,0.08 ,13362.45 +,5.0 ,3.14 ,0.0 +,3.0 ,0.43 ,16703.06 +}; + +double marsR4[]={4.0 +,20.0 ,3.58 ,3340.61 +,16.0 ,4.05 ,6681.22 +,6.0 ,4.46 ,10021.84 +,2.0 ,4.84 ,13362.45 +}; + +double jupiterL0[]={64.0 +,59954691.0 ,0.0 ,0.0 +,9695899.0 ,5.0619179 ,529.6909651 +,573610.0 ,1.444062 ,7.113547 +,306389.0 ,5.417347 ,1059.38193 +,97178.0 ,4.14265 ,632.78374 +,72903.0 ,3.64043 ,522.57742 +,64264.0 ,3.41145 ,103.09277 +,39806.0 ,2.29377 ,419.48464 +,38858.0 ,1.27232 ,316.39187 +,27965.0 ,1.78455 ,536.80451 +,13590.0 ,5.77481 ,1589.0729 +,8769.0 ,3.63 ,949.1756 +,8246.0 ,3.5823 ,206.1855 +,7368.0 ,5.081 ,735.8765 +,6263.0 ,0.025 ,213.2991 +,6114.0 ,4.5132 ,1162.4747 +,5305.0 ,4.1863 ,1052.2684 +,5305.0 ,1.3067 ,14.2271 +,4905.0 ,1.3208 ,110.2063 +,4647.0 ,4.6996 ,3.9322 +,3045.0 ,4.3168 ,426.5982 +,2610.0 ,1.5667 ,846.0828 +,2028.0 ,1.0638 ,3.1814 +,1921.0 ,0.9717 ,639.8973 +,1765.0 ,2.1415 ,1066.4955 +,1723.0 ,3.8804 ,1265.5675 +,1633.0 ,3.582 ,515.4639 +,1432.0 ,4.2968 ,625.6702 +,973.0 ,4.098 ,95.979 +,884.0 ,2.437 ,412.371 +,733.0 ,6.085 ,838.969 +,731.0 ,3.806 ,1581.959 +,709.0 ,1.293 ,742.99 +,692.0 ,6.134 ,2118.764 +,614.0 ,4.109 ,1478.867 +,582.0 ,4.54 ,309.278 +,495.0 ,3.756 ,323.505 +,441.0 ,2.958 ,454.909 +,417.0 ,1.036 ,2.448 +,390.0 ,4.897 ,1692.166 +,376.0 ,4.703 ,1368.66 +,341.0 ,5.715 ,533.623 +,330.0 ,4.74 ,0.048 +,262.0 ,1.877 ,0.963 +,261.0 ,0.82 ,380.128 +,257.0 ,3.724 ,199.072 +,244.0 ,5.22 ,728.763 +,235.0 ,1.227 ,909.819 +,220.0 ,1.651 ,543.918 +,207.0 ,1.855 ,525.759 +,202.0 ,1.807 ,1375.774 +,197.0 ,5.293 ,1155.361 +,175.0 ,3.73 ,942.062 +,175.0 ,3.226 ,1898.351 +,175.0 ,5.91 ,956.289 +,158.0 ,4.365 ,1795.258 +,151.0 ,3.906 ,74.782 +,149.0 ,4.377 ,1685.052 +,141.0 ,3.136 ,491.558 +,138.0 ,1.318 ,1169.588 +,131.0 ,4.169 ,1045.155 +,117.0 ,2.5 ,1596.186 +,117.0 ,3.389 ,0.521 +,106.0 ,4.554 ,526.51 +}; + +double jupiterL1[]={61.0 +,52993480757.0 ,0.0 ,0.0 +,489741.0 ,4.220667 ,529.690965 +,228919.0 ,6.026475 ,7.113547 +,27655.0 ,4.57266 ,1059.38193 +,20721.0 ,5.45939 ,522.57742 +,12106.0 ,0.16986 ,536.80451 +,6068.0 ,4.4242 ,103.0928 +,5434.0 ,3.9848 ,419.4846 +,4238.0 ,5.8901 ,14.2271 +,2212.0 ,5.2677 ,206.1855 +,1746.0 ,4.9267 ,1589.0729 +,1296.0 ,5.5513 ,3.1814 +,1173.0 ,5.8565 ,1052.2684 +,1163.0 ,0.5145 ,3.9322 +,1099.0 ,5.307 ,515.4639 +,1007.0 ,0.4648 ,735.8765 +,1004.0 ,3.1504 ,426.5982 +,848.0 ,5.758 ,110.206 +,827.0 ,4.803 ,213.299 +,816.0 ,0.586 ,1066.495 +,725.0 ,5.518 ,639.897 +,568.0 ,5.989 ,625.67 +,474.0 ,4.132 ,412.371 +,413.0 ,5.737 ,95.979 +,345.0 ,4.242 ,632.784 +,336.0 ,3.732 ,1162.475 +,234.0 ,4.035 ,949.176 +,234.0 ,6.243 ,309.278 +,199.0 ,1.505 ,838.969 +,195.0 ,2.219 ,323.505 +,187.0 ,6.086 ,742.99 +,184.0 ,6.28 ,543.918 +,171.0 ,5.417 ,199.072 +,131.0 ,0.626 ,728.763 +,115.0 ,0.68 ,846.083 +,115.0 ,5.286 ,2118.764 +,108.0 ,4.493 ,956.289 +,80.0 ,5.82 ,1045.15 +,72.0 ,5.34 ,942.06 +,70.0 ,5.97 ,532.87 +,67.0 ,5.73 ,21.34 +,66.0 ,0.13 ,526.51 +,65.0 ,6.09 ,1581.96 +,59.0 ,0.59 ,1155.36 +,58.0 ,0.99 ,1596.19 +,57.0 ,5.97 ,1169.59 +,57.0 ,1.41 ,533.62 +,55.0 ,5.43 ,10.29 +,52.0 ,5.73 ,117.32 +,52.0 ,0.23 ,1368.66 +,50.0 ,6.08 ,525.76 +,47.0 ,3.63 ,1478.87 +,47.0 ,0.51 ,1265.57 +,40.0 ,4.16 ,1692.17 +,34.0 ,0.1 ,302.16 +,33.0 ,5.04 ,220.41 +,32.0 ,5.37 ,508.35 +,29.0 ,5.42 ,1272.68 +,29.0 ,3.36 ,4.67 +,29.0 ,0.76 ,88.87 +,25.0 ,1.61 ,831.86 +}; + +double jupiterL2[]={57.0 +,47234.0 ,4.32148 ,7.11355 +,38966.0 ,0.0 ,0.0 +,30629.0 ,2.93021 ,529.69097 +,3189.0 ,1.055 ,522.5774 +,2729.0 ,4.8455 ,536.8045 +,2723.0 ,3.4141 ,1059.3819 +,1721.0 ,4.1873 ,14.2271 +,383.0 ,5.768 ,419.485 +,378.0 ,0.76 ,515.464 +,367.0 ,6.055 ,103.093 +,337.0 ,3.786 ,3.181 +,308.0 ,0.694 ,206.186 +,218.0 ,3.814 ,1589.073 +,199.0 ,5.34 ,1066.495 +,197.0 ,2.484 ,3.932 +,156.0 ,1.406 ,1052.268 +,146.0 ,3.814 ,639.897 +,142.0 ,1.634 ,426.598 +,130.0 ,5.837 ,412.371 +,117.0 ,1.414 ,625.67 +,97.0 ,4.03 ,110.21 +,91.0 ,1.11 ,95.98 +,87.0 ,2.52 ,632.78 +,79.0 ,4.64 ,543.92 +,72.0 ,2.22 ,735.88 +,58.0 ,0.83 ,199.07 +,57.0 ,3.12 ,213.3 +,49.0 ,1.67 ,309.28 +,40.0 ,4.02 ,21.34 +,40.0 ,0.62 ,323.51 +,36.0 ,2.33 ,728.76 +,29.0 ,3.61 ,10.29 +,28.0 ,3.24 ,838.97 +,26.0 ,4.5 ,742.99 +,26.0 ,2.51 ,1162.47 +,25.0 ,1.22 ,1045.15 +,24.0 ,3.01 ,956.29 +,19.0 ,4.29 ,532.87 +,18.0 ,0.81 ,508.35 +,17.0 ,4.2 ,2118.76 +,17.0 ,1.83 ,526.51 +,15.0 ,5.81 ,1596.19 +,15.0 ,0.68 ,942.06 +,15.0 ,4 ,117.32 +,14.0 ,5.95 ,316.39 +,14.0 ,1.8 ,302.16 +,13.0 ,2.52 ,88.87 +,13.0 ,4.37 ,1169.59 +,11.0 ,4.44 ,525.76 +,10.0 ,1.72 ,1581.96 +,9.0 ,2.18 ,1155.36 +,9.0 ,3.29 ,220.41 +,9.0 ,3.32 ,831.86 +,8.0 ,5.76 ,846.08 +,8.0 ,2.71 ,533.62 +,7.0 ,2.18 ,1265.57 +,6.0 ,0.5 ,949.18 +}; + +double jupiterL3[]={39.0 +,6502.0 ,2.5986 ,7.1135 +,1357.0 ,1.3464 ,529.691 +,471.0 ,2.475 ,14.227 +,417.0 ,3.245 ,536.805 +,353.0 ,2.974 ,522.577 +,155.0 ,2.076 ,1059.382 +,87.0 ,2.51 ,515.46 +,44.0 ,0.0 ,0.0 +,34.0 ,3.83 ,1066.5 +,28.0 ,2.45 ,206.19 +,24.0 ,1.28 ,412.37 +,23.0 ,2.98 ,543.92 +,20.0 ,2.1 ,639.9 +,20.0 ,1.4 ,419.48 +,19.0 ,1.59 ,103.09 +,17.0 ,2.3 ,21.34 +,17.0 ,2.6 ,1589.07 +,16.0 ,3.15 ,625.67 +,16.0 ,3.36 ,1052.27 +,13.0 ,2.76 ,95.98 +,13.0 ,2.54 ,199.07 +,13.0 ,6.27 ,426.6 +,9.0 ,1.76 ,10.29 +,9.0 ,2.27 ,110.21 +,7.0 ,3.43 ,309.28 +,7.0 ,4.04 ,728.76 +,6.0 ,2.52 ,508.35 +,5.0 ,2.91 ,1045.15 +,5.0 ,5.25 ,323.51 +,4.0 ,4.3 ,88.87 +,4.0 ,3.52 ,302.16 +,4.0 ,4.09 ,735.88 +,3.0 ,1.43 ,956.29 +,3.0 ,4.36 ,1596.19 +,3.0 ,1.25 ,213.3 +,3.0 ,5.02 ,838.97 +,3.0 ,2.24 ,117.32 +,2.0 ,2.9 ,742.99 +,2.0 ,2.36 ,942.06 +}; + +double jupiterL4[]={19.0 +,669.0 ,0.853 ,7.114 +,114.0 ,3.142 ,0.0 +,100.0 ,0.743 ,14.227 +,50.0 ,1.65 ,536.8 +,44.0 ,5.82 ,529.69 +,32.0 ,4.86 ,522.58 +,15.0 ,4.29 ,515.46 +,9.0 ,0.71 ,1059.38 +,5.0 ,1.3 ,543.92 +,4.0 ,2.32 ,1066.5 +,4.0 ,0.48 ,21.34 +,3.0 ,3 ,412.37 +,2.0 ,0.4 ,639.9 +,2.0 ,4.26 ,199.07 +,2.0 ,4.91 ,625.67 +,2.0 ,4.26 ,206.19 +,1.0 ,5.26 ,1052.27 +,1.0 ,4.72 ,95.98 +,1.0 ,1.29 ,1589.07 +}; + +double jupiterL5[]={5.0 +,50.0 ,5.26 ,7.11 +,16.0 ,5.25 ,14.23 +,4.0 ,0.01 ,536.8 +,2.0 ,1.1 ,522.58 +,1.0 ,3.14 ,0.0 +}; + +double jupiterB0[]={26.0 +,2268616.0 ,3.5585261 ,529.6909651 +,110090.0 ,0.0 ,0.0 +,109972.0 ,3.908093 ,1059.38193 +,8101.0 ,3.6051 ,522.5774 +,6438.0 ,0.3063 ,536.8045 +,6044.0 ,4.2588 ,1589.0729 +,1107.0 ,2.9853 ,1162.4747 +,944.0 ,1.675 ,426.598 +,942.0 ,2.936 ,1052.268 +,894.0 ,1.754 ,7.114 +,836.0 ,5.179 ,103.093 +,767.0 ,2.155 ,632.784 +,684.0 ,3.678 ,213.299 +,629.0 ,0.643 ,1066.495 +,559.0 ,0.014 ,846.083 +,532.0 ,2.703 ,110.206 +,464.0 ,1.173 ,949.176 +,431.0 ,2.608 ,419.485 +,351.0 ,4.611 ,2118.764 +,132.0 ,4.778 ,742.99 +,123.0 ,3.35 ,1692.166 +,116.0 ,1.387 ,323.505 +,115.0 ,5.049 ,316.392 +,104.0 ,3.701 ,515.464 +,103.0 ,2.319 ,1478.867 +,102.0 ,3.153 ,1581.959 +}; + +double jupiterB1[]={22.0 +,177352.0 ,5.701665 ,529.690965 +,3230.0 ,5.7794 ,1059.3819 +,3081.0 ,5.4746 ,522.5774 +,2212.0 ,4.7348 ,536.8045 +,1694.0 ,3.1416 ,0.0 +,346.0 ,4.746 ,1052.268 +,234.0 ,5.189 ,1066.495 +,196.0 ,6.186 ,7.114 +,150.0 ,3.927 ,1589.073 +,114.0 ,3.439 ,632.784 +,97.0 ,2.91 ,949.18 +,82.0 ,5.08 ,1162.47 +,77.0 ,2.51 ,103.09 +,77.0 ,0.61 ,419.48 +,74.0 ,5.5 ,515.46 +,61.0 ,5.45 ,213.3 +,50.0 ,3.95 ,735.88 +,46.0 ,0.54 ,110.21 +,45.0 ,1.9 ,846.08 +,37.0 ,4.7 ,543.92 +,36.0 ,6.11 ,316.39 +,32.0 ,4.92 ,1581.96 +}; + +double jupiterB2[]={14.0 +,8094.0 ,1.4632 ,529.691 +,813.0 ,3.1416 ,0.0 +,742.0 ,0.957 ,522.577 +,399.0 ,2.899 ,536.805 +,342.0 ,1.447 ,1059.382 +,74.0 ,0.41 ,1052.27 +,46.0 ,3.48 ,1066.5 +,30.0 ,1.93 ,1589.07 +,29.0 ,0.99 ,515.46 +,23.0 ,4.27 ,7.11 +,14.0 ,2.92 ,543.92 +,12.0 ,5.22 ,632.78 +,11.0 ,4.88 ,949.18 +,6.0 ,6.21 ,1045.15 +}; + +double jupiterB3[]={9.0 +,252.0 ,3.381 ,529.691 +,122.0 ,2.733 ,522.577 +,49.0 ,1.04 ,536.8 +,11.0 ,2.31 ,1052.27 +,8.0 ,2.77 ,515.46 +,7.0 ,4.25 ,1059.38 +,6.0 ,1.78 ,1066.5 +,4.0 ,1.13 ,543.92 +,3.0 ,3.14 ,0.0 +}; + +double jupiterB4[]={6.0 +,15.0 ,4.53 ,522.58 +,5.0 ,4.47 ,529.69 +,4.0 ,5.44 ,536.8 +,3.0 ,0.0 ,0.0 +,2.0 ,4.52 ,515.46 +,1.0 ,4.2 ,1052.27 +}; + +double jupiterB5[]={1.0 +,1.0 ,0.09 ,522.58 +}; + +double jupiterR0[]={46.0 +,520887429.0 ,0.0 ,0.0 +,25209327.0 ,3.4910864 ,529.69096509 +,610600.0 ,3.841154 ,1059.38193 +,282029.0 ,2.574199 ,632.783739 +,187647.0 ,2.075904 ,522.577418 +,86793.0 ,0.71001 ,419.48464 +,72063.0 ,0.21466 ,536.80451 +,65517.0 ,5.97996 ,316.39187 +,30135.0 ,2.16132 ,949.17561 +,29135.0 ,1.67759 ,103.09277 +,23947.0 ,0.27458 ,7.11355 +,23453.0 ,3.54023 ,735.87651 +,22284.0 ,4.19363 ,1589.0729 +,13033.0 ,2.96043 ,1162.4747 +,12749.0 ,2.7155 ,1052.26838 +,9703.0 ,1.9067 ,206.1855 +,9161.0 ,4.4135 ,213.2991 +,7895.0 ,2.4791 ,426.5982 +,7058.0 ,2.1818 ,1265.5675 +,6138.0 ,6.2642 ,846.0828 +,5477.0 ,5.6573 ,639.8973 +,4170.0 ,2.0161 ,515.4639 +,4137.0 ,2.7222 ,625.6702 +,3503.0 ,0.5653 ,1066.4955 +,2617.0 ,2.0099 ,1581.9593 +,2500.0 ,4.5518 ,838.9693 +,2128.0 ,6.1275 ,742.9901 +,1912.0 ,0.8562 ,412.3711 +,1611.0 ,3.0887 ,1368.6603 +,1479.0 ,2.6803 ,1478.8666 +,1231.0 ,1.8904 ,323.5054 +,1217.0 ,1.8017 ,110.2063 +,1015.0 ,1.3867 ,454.9094 +,999.0 ,2.872 ,309.278 +,961.0 ,4.549 ,2118.764 +,886.0 ,4.148 ,533.623 +,821.0 ,1.593 ,1898.351 +,812.0 ,5.941 ,909.819 +,777.0 ,3.677 ,728.763 +,727.0 ,3.988 ,1155.361 +,655.0 ,2.791 ,1685.052 +,654.0 ,3.382 ,1692.166 +,621.0 ,4.823 ,956.289 +,615.0 ,2.276 ,942.062 +,562.0 ,0.081 ,543.918 +,542.0 ,0.284 ,525.759 +}; + +double jupiterR1[]={43.0 +,1271802.0 ,2.6493751 ,529.6909651 +,61662.0 ,3.00076 ,1059.38193 +,53444.0 ,3.89718 ,522.57742 +,41390.0 ,0.0 ,0.0 +,31185.0 ,4.88277 ,536.80451 +,11847.0 ,2.4133 ,419.48464 +,9166.0 ,4.7598 ,7.1135 +,3404.0 ,3.3469 ,1589.0729 +,3203.0 ,5.2108 ,735.8765 +,3176.0 ,2.793 ,103.0928 +,2806.0 ,3.7422 ,515.4639 +,2677.0 ,4.3305 ,1052.2684 +,2600.0 ,3.6344 ,206.1855 +,2412.0 ,4.4695 ,426.5982 +,2101.0 ,3.9276 ,639.8973 +,1646.0 ,5.3095 ,1066.4955 +,1641.0 ,4.4163 ,625.6702 +,1050.0 ,3.1611 ,213.2991 +,1025.0 ,2.5543 ,412.3711 +,806.0 ,2.678 ,632.784 +,741.0 ,2.171 ,1162.475 +,677.0 ,6.25 ,838.969 +,567.0 ,4.577 ,742.99 +,485.0 ,2.469 ,949.176 +,469.0 ,4.71 ,543.918 +,445.0 ,0.403 ,323.505 +,416.0 ,5.368 ,728.763 +,402.0 ,4.605 ,309.278 +,347.0 ,4.681 ,14.227 +,338.0 ,3.168 ,956.289 +,261.0 ,5.343 ,846.083 +,247.0 ,3.923 ,942.062 +,220.0 ,4.842 ,1368.66 +,203.0 ,5.6 ,1155.361 +,200.0 ,4.439 ,1045.155 +,197.0 ,3.706 ,2118.764 +,196.0 ,3.759 ,199.072 +,184.0 ,4.265 ,95.979 +,180.0 ,4.402 ,532.872 +,170.0 ,4.846 ,526.51 +,146.0 ,6.13 ,533.623 +,133.0 ,1.322 ,110.206 +,132.0 ,4.512 ,525.759 +}; + +double jupiterR2[]={36.0 +,79645.0 ,1.35866 ,529.69097 +,8252.0 ,5.7777 ,522.5774 +,7030.0 ,3.2748 ,536.8045 +,5314.0 ,1.8384 ,1059.3819 +,1861.0 ,2.9768 ,7.1135 +,964.0 ,5.48 ,515.464 +,836.0 ,4.199 ,419.485 +,498.0 ,3.142 ,0.0 +,427.0 ,2.228 ,639.897 +,406.0 ,3.783 ,1066.495 +,377.0 ,2.242 ,1589.073 +,363.0 ,5.368 ,206.186 +,342.0 ,6.099 ,1052.268 +,339.0 ,6.127 ,625.67 +,333.0 ,0.003 ,426.598 +,280.0 ,4.262 ,412.371 +,257.0 ,0.963 ,632.784 +,230.0 ,0.705 ,735.877 +,201.0 ,3.069 ,543.918 +,200.0 ,4.429 ,103.093 +,139.0 ,2.932 ,14.227 +,114.0 ,0.787 ,728.763 +,95.0 ,1.7 ,838.97 +,86.0 ,5.14 ,323.51 +,83.0 ,0.06 ,309.28 +,80.0 ,2.98 ,742.99 +,75.0 ,1.6 ,956.29 +,70.0 ,1.51 ,213.3 +,67.0 ,5.47 ,199.07 +,62.0 ,6.1 ,1045.15 +,56.0 ,0.96 ,1162.47 +,52.0 ,5.58 ,942.06 +,50.0 ,2.72 ,532.87 +,45.0 ,5.52 ,508.35 +,44.0 ,0.27 ,526.51 +,40.0 ,5.95 ,95.98 +}; + +double jupiterR3[]={28.0 +,3519.0 ,6.058 ,529.691 +,1073.0 ,1.6732 ,536.8045 +,916.0 ,1.413 ,522.577 +,342.0 ,0.523 ,1059.382 +,255.0 ,1.196 ,7.114 +,222.0 ,0.952 ,515.464 +,90.0 ,3.14 ,0.0 +,69.0 ,2.27 ,1066.5 +,58.0 ,1.41 ,543.92 +,58.0 ,0.53 ,639.9 +,51.0 ,5.98 ,412.37 +,47.0 ,1.58 ,625.67 +,43.0 ,6.12 ,419.48 +,37.0 ,1.18 ,14.23 +,34.0 ,1.67 ,1052.27 +,34.0 ,0.85 ,206.19 +,31.0 ,1.04 ,1589.07 +,30.0 ,4.63 ,426.6 +,21.0 ,2.5 ,728.76 +,15.0 ,0.89 ,199.07 +,14.0 ,0.96 ,508.35 +,13.0 ,1.5 ,1045.15 +,12.0 ,2.61 ,735.88 +,12.0 ,3.56 ,323.51 +,11.0 ,1.79 ,309.28 +,11.0 ,6.28 ,956.29 +,10.0 ,6.26 ,103.09 +,9.0 ,3.45 ,838.97 +}; + +double jupiterR4[]={15.0 +,129.0 ,0.084 ,536.805 +,113.0 ,4.249 ,529.691 +,83.0 ,3.3 ,522.58 +,38.0 ,2.73 ,515.46 +,27.0 ,5.69 ,7.11 +,18.0 ,5.4 ,1059.38 +,13.0 ,6.02 ,543.92 +,9.0 ,0.77 ,1066.5 +,8.0 ,5.68 ,14.23 +,7.0 ,1.43 ,412.37 +,6.0 ,5.12 ,639.9 +,5.0 ,3.34 ,625.67 +,3.0 ,3.4 ,1052.27 +,3.0 ,4.16 ,728.76 +,3.0 ,2.9 ,426.6 +}; + +double jupiterR5[]={7.0 +,11.0 ,4.75 ,536.8 +,4.0 ,5.92 ,522.58 +,2.0 ,5.57 ,515.46 +,2.0 ,4.3 ,543.92 +,2.0 ,3.69 ,7.11 +,2.0 ,4.13 ,1059.38 +,2.0 ,5.49 ,1066.5 +}; + +double saturnL0[]={90.0 +,87401354.0 ,0.0 ,0.0 +,11107660.0 ,3.9620509 ,213.29909544 +,1414151.0 ,4.5858152 ,7.113547 +,398379.0 ,0.52112 ,206.185548 +,350769.0 ,3.303299 ,426.598191 +,206816.0 ,0.246584 ,103.092774 +,79271.0 ,3.84007 ,220.41264 +,23990.0 ,4.66977 ,110.20632 +,16574.0 ,0.43719 ,419.48464 +,15820.0 ,0.93809 ,632.78374 +,15054.0 ,2.7167 ,639.89729 +,14907.0 ,5.76903 ,316.39187 +,14610.0 ,1.56519 ,3.93215 +,13160.0 ,4.44891 ,14.22709 +,13005.0 ,5.98119 ,11.0457 +,10725.0 ,3.1294 ,202.2534 +,6126.0 ,1.7633 ,277.035 +,5863.0 ,0.2366 ,529.691 +,5228.0 ,4.2078 ,3.1814 +,5020.0 ,3.1779 ,433.7117 +,4593.0 ,0.6198 ,199.072 +,4006.0 ,2.2448 ,63.7359 +,3874.0 ,3.2228 ,138.5175 +,3269.0 ,0.7749 ,949.1756 +,2954.0 ,0.9828 ,95.9792 +,2461.0 ,2.0316 ,735.8765 +,1758.0 ,3.2658 ,522.5774 +,1640.0 ,5.505 ,846.0828 +,1581.0 ,4.3727 ,309.2783 +,1391.0 ,4.0233 ,323.5054 +,1124.0 ,2.8373 ,415.5525 +,1087.0 ,4.1834 ,2.4477 +,1017.0 ,3.717 ,227.5262 +,957.0 ,0.507 ,1265.567 +,853.0 ,3.421 ,175.166 +,849.0 ,3.191 ,209.367 +,789.0 ,5.007 ,0.963 +,749.0 ,2.144 ,853.196 +,744.0 ,5.253 ,224.345 +,687.0 ,1.747 ,1052.268 +,654.0 ,1.599 ,0.048 +,634.0 ,2.299 ,412.371 +,625.0 ,0.97 ,210.118 +,580.0 ,3.093 ,74.782 +,546.0 ,2.127 ,350.332 +,543.0 ,1.518 ,9.561 +,530.0 ,4.449 ,117.32 +,478.0 ,2.965 ,137.033 +,474.0 ,5.475 ,742.99 +,452.0 ,1.044 ,490.334 +,449.0 ,1.29 ,127.472 +,372.0 ,2.278 ,217.231 +,355.0 ,3.013 ,838.969 +,347.0 ,1.539 ,340.771 +,343.0 ,0.246 ,0.521 +,330.0 ,0.247 ,1581.959 +,322.0 ,0.961 ,203.738 +,322.0 ,2.572 ,647.011 +,309.0 ,3.495 ,216.48 +,287.0 ,2.37 ,351.817 +,278.0 ,0.4 ,211.815 +,249.0 ,1.47 ,1368.66 +,227.0 ,4.91 ,12.53 +,220.0 ,4.204 ,200.769 +,209.0 ,1.345 ,625.67 +,208.0 ,0.483 ,1162.475 +,208.0 ,1.283 ,39.357 +,204.0 ,6.011 ,265.989 +,185.0 ,3.503 ,149.563 +,184.0 ,0.973 ,4.193 +,182.0 ,5.491 ,2.921 +,174.0 ,1.863 ,0.751 +,165.0 ,0.44 ,5.417 +,149.0 ,5.736 ,52.69 +,148.0 ,1.535 ,5.629 +,146.0 ,6.231 ,195.14 +,140.0 ,4.295 ,21.341 +,131.0 ,4.068 ,10.295 +,125.0 ,6.277 ,1898.351 +,122.0 ,1.976 ,4.666 +,118.0 ,5.341 ,554.07 +,117.0 ,2.679 ,1155.361 +,114.0 ,5.594 ,1059.382 +,112.0 ,1.105 ,191.208 +,110.0 ,0.166 ,1.484 +,109.0 ,3.438 ,536.805 +,107.0 ,4.012 ,956.289 +,104.0 ,2.192 ,88.866 +,103.0 ,1.197 ,1685.052 +,101.0 ,4.965 ,269.921 +}; + +double saturnL1[]={79.0 +,21354295596.0 ,0.0 ,0.0 +,1296855.0 ,1.8282054 ,213.2990954 +,564348.0 ,1.885001 ,7.113547 +,107679.0 ,2.277699 ,206.185548 +,98323.0 ,1.0807 ,426.59819 +,40255.0 ,2.04128 ,220.41264 +,19942.0 ,1.27955 ,103.09277 +,10512.0 ,2.7488 ,14.22709 +,6939.0 ,0.4049 ,639.8973 +,4803.0 ,2.4419 ,419.4846 +,4056.0 ,2.9217 ,110.2063 +,3769.0 ,3.6497 ,3.9322 +,3385.0 ,2.4169 ,3.1814 +,3302.0 ,1.2626 ,433.7117 +,3071.0 ,2.3274 ,199.072 +,1953.0 ,3.5639 ,11.0457 +,1249.0 ,2.628 ,95.9792 +,922.0 ,1.961 ,227.526 +,706.0 ,4.417 ,529.691 +,650.0 ,6.174 ,202.253 +,628.0 ,6.111 ,309.278 +,487.0 ,6.04 ,853.196 +,479.0 ,4.988 ,522.577 +,468.0 ,4.617 ,63.736 +,417.0 ,2.117 ,323.505 +,408.0 ,1.299 ,209.367 +,352.0 ,2.317 ,632.784 +,344.0 ,3.959 ,412.371 +,340.0 ,3.634 ,316.392 +,336.0 ,3.772 ,735.877 +,332.0 ,2.861 ,210.118 +,289.0 ,2.733 ,117.32 +,281.0 ,5.744 ,2.448 +,266.0 ,0.543 ,647.011 +,230.0 ,1.644 ,216.48 +,192.0 ,2.965 ,224.345 +,173.0 ,4.077 ,846.083 +,167.0 ,2.597 ,21.341 +,136.0 ,2.286 ,10.295 +,131.0 ,3.441 ,742.99 +,128.0 ,4.095 ,217.231 +,109.0 ,6.161 ,415.552 +,98.0 ,4.73 ,838.97 +,94.0 ,3.48 ,1052.27 +,92.0 ,3.95 ,88.87 +,87.0 ,1.22 ,440.83 +,83.0 ,3.11 ,625.67 +,78.0 ,6.24 ,302.16 +,67.0 ,0.29 ,4.67 +,66.0 ,5.65 ,9.56 +,62.0 ,4.29 ,127.47 +,62.0 ,1.83 ,195.14 +,58.0 ,2.48 ,191.96 +,57.0 ,5.02 ,137.03 +,55.0 ,0.28 ,74.78 +,54.0 ,5.13 ,490.33 +,51.0 ,1.46 ,536.8 +,47.0 ,1.18 ,149.56 +,47.0 ,5.15 ,515.46 +,46.0 ,2.23 ,956.29 +,44.0 ,2.71 ,5.42 +,40.0 ,0.41 ,269.92 +,40.0 ,3.89 ,728.76 +,38.0 ,0.65 ,422.67 +,38.0 ,2.53 ,12.53 +,37.0 ,3.78 ,2.92 +,35.0 ,6.08 ,5.63 +,34.0 ,3.21 ,1368.66 +,33.0 ,4.64 ,277.03 +,33.0 ,5.43 ,1066.5 +,33.0 ,0.3 ,351.82 +,32.0 ,4.39 ,1155.36 +,31.0 ,2.43 ,52.69 +,30.0 ,2.84 ,203 +,30.0 ,6.19 ,284.15 +,30.0 ,3.39 ,1059.38 +,29.0 ,2.03 ,330.62 +,28.0 ,2.74 ,265.99 +,26.0 ,4.51 ,340.77 +}; + +double saturnL2[]={63.0 +,116441.0 ,1.179879 ,7.113547 +,91921.0 ,0.07425 ,213.2991 +,90592.0 ,0.0 ,0.0 +,15277.0 ,4.06492 ,206.18555 +,10631.0 ,0.25778 ,220.41264 +,10605.0 ,5.40964 ,426.59819 +,4265.0 ,1.046 ,14.2271 +,1216.0 ,2.9186 ,103.0928 +,1165.0 ,4.6094 ,639.8973 +,1082.0 ,5.6913 ,433.7117 +,1045.0 ,4.0421 ,199.072 +,1020.0 ,0.6337 ,3.1814 +,634.0 ,4.388 ,419.485 +,549.0 ,5.573 ,3.932 +,457.0 ,1.268 ,110.206 +,425.0 ,0.209 ,227.526 +,274.0 ,4.288 ,95.979 +,162.0 ,1.381 ,11.046 +,129.0 ,1.566 ,309.278 +,117.0 ,3.881 ,853.196 +,105.0 ,4.9 ,647.011 +,101.0 ,0.893 ,21.341 +,96.0 ,2.91 ,316.39 +,95.0 ,5.63 ,412.37 +,85.0 ,5.73 ,209.37 +,83.0 ,6.05 ,216.48 +,82.0 ,1.02 ,117.32 +,75.0 ,4.76 ,210.12 +,67.0 ,0.46 ,522.58 +,66.0 ,0.48 ,10.29 +,64.0 ,0.35 ,323.51 +,61.0 ,4.88 ,632.78 +,53.0 ,2.75 ,529.69 +,46.0 ,5.69 ,440.83 +,45.0 ,1.67 ,202.25 +,42.0 ,5.71 ,88.87 +,32.0 ,0.07 ,63.74 +,32.0 ,1.67 ,302.16 +,31.0 ,4.16 ,191.96 +,27.0 ,0.83 ,224.34 +,25.0 ,5.66 ,735.88 +,20.0 ,5.94 ,217.23 +,18.0 ,4.9 ,625.67 +,17.0 ,1.63 ,742.99 +,16.0 ,0.58 ,515.46 +,14.0 ,0.21 ,838.97 +,14.0 ,3.76 ,195.14 +,12.0 ,4.72 ,203 +,12.0 ,0.13 ,234.64 +,12.0 ,3.12 ,846.08 +,11.0 ,5.92 ,536.8 +,11.0 ,5.6 ,728.76 +,11.0 ,3.2 ,1066.5 +,10.0 ,4.99 ,422.67 +,10.0 ,0.26 ,330.62 +,10.0 ,4.15 ,860.31 +,9.0 ,0.46 ,956.29 +,8.0 ,2.14 ,269.92 +,8.0 ,5.25 ,429.78 +,8.0 ,4.03 ,9.56 +,7.0 ,5.4 ,1052.27 +,6.0 ,4.46 ,284.15 +,6.0 ,5.93 ,405.26 +}; + +double saturnL3[]={48.0 +,16039.0 ,5.73945 ,7.11355 +,4250.0 ,4.5854 ,213.2991 +,1907.0 ,4.7608 ,220.4126 +,1466.0 ,5.9133 ,206.1855 +,1162.0 ,5.6197 ,14.2271 +,1067.0 ,3.6082 ,426.5982 +,239.0 ,3.861 ,433.712 +,237.0 ,5.768 ,199.072 +,166.0 ,5.116 ,3.181 +,151.0 ,2.736 ,639.897 +,131.0 ,4.743 ,227.526 +,63.0 ,0.23 ,419.48 +,62.0 ,4.74 ,103.09 +,40.0 ,5.47 ,21.34 +,40.0 ,5.96 ,95.98 +,39.0 ,5.83 ,110.21 +,28.0 ,3.01 ,647.01 +,25.0 ,0.99 ,3.93 +,19.0 ,1.92 ,853.2 +,18.0 ,4.97 ,10.29 +,18.0 ,1.03 ,412.37 +,18.0 ,4.2 ,216.48 +,18.0 ,3.32 ,309.28 +,16.0 ,3.9 ,440.83 +,16.0 ,5.62 ,117.32 +,13.0 ,1.18 ,88.87 +,13.0 ,5.58 ,11.05 +,11.0 ,5.93 ,191.96 +,10.0 ,3.95 ,209.37 +,9.0 ,3.39 ,302.16 +,8.0 ,4.88 ,323.51 +,7.0 ,0.38 ,632.78 +,6.0 ,2.25 ,522.58 +,6.0 ,1.06 ,210.12 +,5.0 ,4.64 ,234.64 +,4.0 ,3.14 ,0.0 +,4.0 ,2.31 ,515.46 +,3.0 ,2.2 ,860.31 +,3.0 ,0.59 ,529.69 +,3.0 ,4.93 ,224.34 +,3.0 ,0.42 ,625.67 +,2.0 ,4.77 ,330.62 +,2.0 ,3.35 ,429.78 +,2.0 ,3.2 ,202.25 +,2.0 ,1.19 ,1066.5 +,2.0 ,1.35 ,405.26 +,2.0 ,4.16 ,223.59 +,2.0 ,3.07 ,654.12 +}; + +double saturnL4[]={27.0 +,1662.0 ,3.9983 ,7.1135 +,257.0 ,2.984 ,220.413 +,236.0 ,3.902 ,14.227 +,149.0 ,2.741 ,213.299 +,114.0 ,3.142 ,0.0 +,110.0 ,1.515 ,206.186 +,68.0 ,1.72 ,426.6 +,40.0 ,2.05 ,433.71 +,38.0 ,1.24 ,199.07 +,31.0 ,3.01 ,227.53 +,15.0 ,0.83 ,639.9 +,9.0 ,3.71 ,21.34 +,6.0 ,2.42 ,419.48 +,6.0 ,1.16 ,647.01 +,4.0 ,1.45 ,95.98 +,4.0 ,2.12 ,440.83 +,3.0 ,4.09 ,110.21 +,3.0 ,2.77 ,412.37 +,3.0 ,3.01 ,88.87 +,3.0 ,0.0 ,853.2 +,3.0 ,0.39 ,103.09 +,2.0 ,3.78 ,117.32 +,2.0 ,2.83 ,234.64 +,2.0 ,5.08 ,309.28 +,2.0 ,2.24 ,216.48 +,2.0 ,5.19 ,302.16 +,1.0 ,1.55 ,191.96 +}; + +double saturnL5[]={12.0 +,124.0 ,2.259 ,7.114 +,34.0 ,2.16 ,14.23 +,28.0 ,1.2 ,220.41 +,6.0 ,1.22 ,227.53 +,5.0 ,0.24 ,433.71 +,4.0 ,6.23 ,426.6 +,3.0 ,2.97 ,199.07 +,3.0 ,4.29 ,206.19 +,2.0 ,6.25 ,213.3 +,1.0 ,5.28 ,639.9 +,1.0 ,0.24 ,440.83 +,1.0 ,3.14 ,0.0 +}; + +double saturnB0[]={34.0 +,4330678.0 ,3.6028443 ,213.2990954 +,240348.0 ,2.852385 ,426.598191 +,84746.0 ,0.0 ,0.0 +,34116.0 ,0.57297 ,206.18555 +,30863.0 ,3.48442 ,220.41264 +,14734.0 ,2.11847 ,639.89729 +,9917.0 ,5.79 ,419.4846 +,6994.0 ,4.736 ,7.1135 +,4808.0 ,5.4331 ,316.3919 +,4788.0 ,4.9651 ,110.2063 +,3432.0 ,2.7326 ,433.7117 +,1506.0 ,6.013 ,103.0928 +,1060.0 ,5.631 ,529.691 +,969.0 ,5.204 ,632.784 +,942.0 ,1.396 ,853.196 +,708.0 ,3.803 ,323.505 +,552.0 ,5.131 ,202.253 +,400.0 ,3.359 ,227.526 +,319.0 ,3.626 ,209.367 +,316.0 ,1.997 ,647.011 +,314.0 ,0.465 ,217.231 +,284.0 ,4.886 ,224.345 +,236.0 ,2.139 ,11.046 +,215.0 ,5.95 ,846.083 +,209.0 ,2.12 ,415.552 +,207.0 ,0.73 ,199.072 +,179.0 ,2.954 ,63.736 +,141.0 ,0.644 ,490.334 +,139.0 ,4.595 ,14.227 +,139.0 ,1.998 ,735.877 +,135.0 ,5.245 ,742.99 +,122.0 ,3.115 ,522.577 +,116.0 ,3.109 ,216.48 +,114.0 ,0.963 ,210.118 +}; + +double saturnB1[]={32.0 +,397555.0 ,5.3329 ,213.299095 +,49479.0 ,3.14159 ,0.0 +,18572.0 ,6.09919 ,426.59819 +,14801.0 ,2.30586 ,206.18555 +,9644.0 ,1.6967 ,220.4126 +,3757.0 ,1.2543 ,419.4846 +,2717.0 ,5.9117 ,639.8973 +,1455.0 ,0.8516 ,433.7117 +,1291.0 ,2.9177 ,7.1135 +,853.0 ,0.436 ,316.392 +,298.0 ,0.919 ,632.784 +,292.0 ,5.316 ,853.196 +,284.0 ,1.619 ,227.526 +,275.0 ,3.889 ,103.093 +,172.0 ,0.052 ,647.011 +,166.0 ,2.444 ,199.072 +,158.0 ,5.209 ,110.206 +,128.0 ,1.207 ,529.691 +,110.0 ,2.457 ,217.231 +,82.0 ,2.76 ,210.12 +,81.0 ,2.86 ,14.23 +,69.0 ,1.66 ,202.25 +,65.0 ,1.26 ,216.48 +,61.0 ,1.25 ,209.37 +,59.0 ,1.82 ,323.51 +,46.0 ,0.82 ,440.83 +,36.0 ,1.82 ,224.34 +,34.0 ,2.84 ,117.32 +,33.0 ,1.31 ,412.37 +,32.0 ,1.19 ,846.08 +,27.0 ,4.65 ,1066.5 +,27.0 ,4.44 ,11.05 +}; + +double saturnB2[]={29.0 +,20630.0 ,0.50482 ,213.2991 +,3720.0 ,3.9983 ,206.1855 +,1627.0 ,6.1819 ,220.4126 +,1346.0 ,0.0 ,0.0 +,706.0 ,3.039 ,419.485 +,365.0 ,5.099 ,426.598 +,330.0 ,5.279 ,433.712 +,219.0 ,3.828 ,639.897 +,139.0 ,1.043 ,7.114 +,104.0 ,6.157 ,227.526 +,93.0 ,1.98 ,316.39 +,71.0 ,4.15 ,199.07 +,52.0 ,2.88 ,632.78 +,49.0 ,4.43 ,647.01 +,41.0 ,3.16 ,853.2 +,29.0 ,4.53 ,210.12 +,24.0 ,1.12 ,14.23 +,21.0 ,4.35 ,217.23 +,20.0 ,5.31 ,440.83 +,18.0 ,0.85 ,110.21 +,17.0 ,5.68 ,216.48 +,16.0 ,4.26 ,103.09 +,14.0 ,3 ,412.37 +,12.0 ,2.53 ,529.69 +,8.0 ,3.32 ,202.25 +,7.0 ,5.56 ,209.37 +,7.0 ,0.29 ,323.51 +,6.0 ,1.16 ,117.32 +,6.0 ,3.61 ,860.31 +}; + +double saturnB3[]={21.0 +,666.0 ,1.99 ,213.299 +,632.0 ,5.698 ,206.186 +,398.0 ,0.0 ,0.0 +,188.0 ,4.338 ,220.413 +,92.0 ,4.84 ,419.48 +,52.0 ,3.42 ,433.71 +,42.0 ,2.38 ,426.6 +,26.0 ,4.4 ,227.53 +,21.0 ,5.85 ,199.07 +,18.0 ,1.99 ,639.9 +,11.0 ,5.37 ,7.11 +,10.0 ,2.55 ,647.01 +,7.0 ,3.46 ,316.39 +,6.0 ,4.8 ,632.78 +,6.0 ,0.02 ,210.12 +,6.0 ,3.52 ,440.83 +,5.0 ,5.64 ,14.23 +,5.0 ,1.22 ,853.2 +,4.0 ,4.71 ,412.37 +,3.0 ,0.63 ,103.09 +,2.0 ,3.72 ,216.48 +}; + +double saturnB4[]={12.0 +,80.0 ,1.12 ,206.19 +,32.0 ,3.12 ,213.3 +,17.0 ,2.48 ,220.41 +,12.0 ,3.14 ,0.0 +,9.0 ,0.38 ,419.48 +,6.0 ,1.56 ,433.71 +,5.0 ,2.63 ,227.53 +,5.0 ,1.28 ,199.07 +,1.0 ,1.43 ,426.6 +,1.0 ,0.67 ,647.01 +,1.0 ,1.72 ,440.83 +,1.0 ,6.18 ,639.9 +}; + +double saturnB5[]={2.0 +,8.0 ,2.82 ,206.19 +,1.0 ,0.51 ,220.41 +}; + +double saturnR0[]={44.0 +,955758136.0 ,0.0 ,0.0 +,52921382.0 ,2.3922622 ,213.29909544 +,1873680.0 ,5.2354961 ,206.1855484 +,1464664.0 ,1.6476305 ,426.5981909 +,821891.0 ,5.9352 ,316.39187 +,547507.0 ,5.015326 ,103.092774 +,371684.0 ,2.271148 ,220.412642 +,361778.0 ,3.139043 ,7.113547 +,140618.0 ,5.704067 ,632.783739 +,108975.0 ,3.293136 ,110.206321 +,69007.0 ,5.941 ,419.48464 +,61053.0 ,0.94038 ,639.89729 +,48913.0 ,1.55733 ,202.2534 +,34144.0 ,0.19519 ,277.03499 +,32402.0 ,5.47085 ,949.17561 +,20937.0 ,0.46349 ,735.87651 +,20839.0 ,1.52103 ,733.71174 +,20747.0 ,5.33256 ,199.072 +,15298.0 ,3.05944 ,529.69097 +,14296.0 ,2.60434 ,323.50542 +,12884.0 ,1.64892 ,138.5175 +,11993.0 ,5.98051 ,846.08283 +,11380.0 ,1.73106 ,522.57742 +,9796.0 ,5.2048 ,1265.5675 +,7753.0 ,5.8519 ,95.9792 +,6771.0 ,3.0043 ,14.2271 +,6466.0 ,0.1773 ,1052.2684 +,5850.0 ,1.4552 ,415.5525 +,5307.0 ,0.5974 ,63.7359 +,4696.0 ,2.1492 ,227.5262 +,4044.0 ,1.6401 ,209.3669 +,3688.0 ,0.7802 ,412.3711 +,3461.0 ,1.8509 ,175.1661 +,3420.0 ,4.9455 ,1581.9593 +,3401.0 ,0.5539 ,350.3321 +,3376.0 ,3.6953 ,224.3448 +,2976.0 ,5.6847 ,210.1177 +,2885.0 ,1.3876 ,838.9693 +,2881.0 ,0.1796 ,853.1964 +,2508.0 ,3.5385 ,742.9901 +,2448.0 ,6.1841 ,1368.6603 +,2406.0 ,2.9656 ,117.3199 +,2174.0 ,0.0151 ,340.7709 +,2024.0 ,5.0541 ,11.0457 +}; + +double saturnR1[]={38.0 +,6182981.0 ,0.2584352 ,213.2990954 +,506578.0 ,0.711147 ,206.185548 +,341394.0 ,5.796358 ,426.598191 +,188491.0 ,0.472157 ,220.412642 +,186262.0 ,3.141593 ,0.0 +,143891.0 ,1.407449 ,7.113547 +,49621.0 ,6.01744 ,103.09277 +,20928.0 ,5.09246 ,639.89729 +,19953.0 ,1.1756 ,419.48464 +,18840.0 ,1.6082 ,110.20632 +,13877.0 ,0.75886 ,199.072 +,12893.0 ,5.9433 ,433.71174 +,5397.0 ,1.2885 ,14.2271 +,4869.0 ,0.8679 ,323.5054 +,4247.0 ,0.393 ,227.5262 +,3252.0 ,1.2585 ,95.9792 +,3081.0 ,3.4366 ,522.5774 +,2909.0 ,4.6068 ,202.2534 +,2856.0 ,2.1673 ,735.8765 +,1988.0 ,2.4505 ,412.3711 +,1941.0 ,6.0239 ,209.3669 +,1581.0 ,1.2919 ,210.1177 +,1340.0 ,4.308 ,853.1964 +,1316.0 ,1.253 ,117.3199 +,1203.0 ,1.8665 ,316.3919 +,1091.0 ,0.0753 ,216.4805 +,966.0 ,0.48 ,632.784 +,954.0 ,5.152 ,647.011 +,898.0 ,0.983 ,529.691 +,882.0 ,1.885 ,1052.268 +,874.0 ,1.402 ,224.345 +,785.0 ,3.064 ,838.969 +,740.0 ,1.382 ,625.67 +,658.0 ,4.144 ,309.278 +,650.0 ,1.725 ,742.99 +,613.0 ,3.033 ,63.736 +,599.0 ,2.549 ,217.231 +,503.0 ,2.13 ,3.932 +}; + +double saturnR2[]={32.0 +,436902.0 ,4.786717 ,213.299095 +,71923.0 ,2.5007 ,206.18555 +,49767.0 ,4.97168 ,220.41264 +,43221.0 ,3.8694 ,426.59819 +,29646.0 ,5.9631 ,7.11355 +,4721.0 ,2.4753 ,199.072 +,4142.0 ,4.1067 ,433.7117 +,3789.0 ,3.0977 ,639.8973 +,2964.0 ,1.3721 ,103.0928 +,2556.0 ,2.8507 ,419.4846 +,2327.0 ,0.0 ,0.0 +,2208.0 ,6.2759 ,110.2063 +,2188.0 ,5.8555 ,14.2271 +,1957.0 ,4.9245 ,227.5262 +,924.0 ,5.464 ,323.505 +,706.0 ,2.971 ,95.979 +,546.0 ,4.129 ,412.371 +,431.0 ,5.178 ,522.577 +,405.0 ,4.173 ,209.367 +,391.0 ,4.481 ,216.48 +,374.0 ,5.834 ,117.32 +,361.0 ,3.277 ,647.011 +,356.0 ,3.192 ,210.118 +,326.0 ,2.269 ,853.196 +,207.0 ,4.022 ,735.877 +,204.0 ,0.088 ,202.253 +,180.0 ,3.597 ,632.784 +,178.0 ,4.097 ,440.825 +,154.0 ,3.135 ,625.67 +,148.0 ,0.136 ,302.165 +,133.0 ,2.594 ,191.958 +,132.0 ,5.933 ,309.278 +}; + +double saturnR3[]={28.0 +,20315.0 ,3.02187 ,213.2991 +,8924.0 ,3.1914 ,220.4126 +,6909.0 ,4.3517 ,206.1855 +,4087.0 ,4.2241 ,7.1135 +,3879.0 ,2.0106 ,426.5982 +,1071.0 ,4.2036 ,199.072 +,907.0 ,2.283 ,433.712 +,606.0 ,3.175 ,227.526 +,597.0 ,4.135 ,14.227 +,483.0 ,1.173 ,639.897 +,393.0 ,0.0 ,0.0 +,229.0 ,4.698 ,419.485 +,188.0 ,4.59 ,110.206 +,150.0 ,3.202 ,103.093 +,121.0 ,3.768 ,323.505 +,102.0 ,4.71 ,95.979 +,101.0 ,5.819 ,412.371 +,93.0 ,1.44 ,647.01 +,84.0 ,2.63 ,216.48 +,73.0 ,4.15 ,117.32 +,62.0 ,2.31 ,440.83 +,55.0 ,0.31 ,853.2 +,50.0 ,2.39 ,209.37 +,45.0 ,4.37 ,191.96 +,41.0 ,0.69 ,522.58 +,40.0 ,1.84 ,302.16 +,38.0 ,5.94 ,88.87 +,32.0 ,4.01 ,21.34 +}; + +double saturnR4[]={23.0 +,1202.0 ,1.415 ,220.4126 +,708.0 ,1.162 ,213.299 +,516.0 ,6.24 ,206.186 +,427.0 ,2.469 ,7.114 +,268.0 ,0.187 ,426.598 +,170.0 ,5.959 ,199.072 +,150.0 ,0.48 ,433.712 +,145.0 ,1.442 ,227.526 +,121.0 ,2.405 ,14.227 +,47.0 ,5.57 ,639.9 +,19.0 ,5.86 ,647.01 +,17.0 ,0.53 ,440.83 +,16.0 ,2.9 ,110.21 +,15.0 ,0.3 ,419.48 +,14.0 ,1.3 ,412.37 +,13.0 ,2.09 ,323.51 +,11.0 ,0.22 ,95.98 +,11.0 ,2.46 ,117.32 +,10.0 ,3.14 ,0.0 +,9.0 ,1.56 ,88.87 +,9.0 ,2.28 ,21.34 +,9.0 ,0.68 ,216.48 +,8.0 ,1.27 ,234.64 +}; + +double saturnR5[]={18.0 +,129.0 ,5.913 ,220.413 +,32.0 ,0.69 ,7.11 +,27.0 ,5.91 ,227.53 +,20.0 ,4.95 ,433.71 +,20.0 ,0.67 ,14.23 +,14.0 ,2.67 ,206.19 +,14.0 ,1.46 ,199.07 +,13.0 ,4.59 ,426.6 +,7.0 ,4.63 ,213.3 +,5.0 ,3.61 ,639.9 +,4.0 ,4.9 ,440.83 +,3.0 ,4.07 ,647.01 +,3.0 ,4.66 ,191.96 +,3.0 ,0.49 ,323.51 +,3.0 ,3.18 ,419.48 +,2.0 ,3.7 ,88.87 +,2.0 ,3.32 ,95.98 +,2.0 ,0.56 ,117.32 +}; + +double uranusL0[]={91.0 +,548129294.0 ,0.0 ,0.0 +,9260408.0 ,0.8910642 ,74.7815986 +,1504248.0 ,3.6271926 ,1.4844727 +,365982.0 ,1.899622 ,73.297126 +,272328.0 ,3.358237 ,149.563197 +,70328.0 ,5.39254 ,63.7359 +,68893.0 ,6.09292 ,76.26607 +,61999.0 ,2.26952 ,2.96895 +,61951.0 ,2.85099 ,11.0457 +,26469.0 ,3.14152 ,71.81265 +,25711.0 ,6.1138 ,454.90937 +,21079.0 ,4.36059 ,148.07872 +,17819.0 ,1.74437 ,36.64856 +,14613.0 ,4.73732 ,3.93215 +,11163.0 ,5.82682 ,224.3448 +,10998.0 ,0.48865 ,138.5175 +,9527.0 ,2.9552 ,35.1641 +,7546.0 ,5.2363 ,109.9457 +,4220.0 ,3.2333 ,70.8494 +,4052.0 ,2.2775 ,151.0477 +,3490.0 ,5.4831 ,146.5943 +,3355.0 ,1.0655 ,4.4534 +,3144.0 ,4.752 ,77.7505 +,2927.0 ,4.629 ,9.5612 +,2922.0 ,5.3524 ,85.8273 +,2273.0 ,4.366 ,70.3282 +,2149.0 ,0.6075 ,38.133 +,2051.0 ,1.5177 ,0.1119 +,1992.0 ,4.9244 ,277.035 +,1667.0 ,3.6274 ,380.1278 +,1533.0 ,2.5859 ,52.6902 +,1376.0 ,2.0428 ,65.2204 +,1372.0 ,4.1964 ,111.4302 +,1284.0 ,3.1135 ,202.2534 +,1282.0 ,0.5427 ,222.8603 +,1244.0 ,0.9161 ,2.4477 +,1221.0 ,0.199 ,108.4612 +,1151.0 ,4.179 ,33.6796 +,1150.0 ,0.9334 ,3.1814 +,1090.0 ,1.775 ,12.5302 +,1072.0 ,0.2356 ,62.2514 +,946.0 ,1.192 ,127.472 +,708.0 ,5.183 ,213.299 +,653.0 ,0.966 ,78.714 +,628.0 ,0.182 ,984.6 +,607.0 ,5.432 ,529.691 +,559.0 ,3.358 ,0.521 +,524.0 ,2.013 ,299.126 +,483.0 ,2.106 ,0.963 +,471.0 ,1.407 ,184.727 +,467.0 ,0.415 ,145.11 +,434.0 ,5.521 ,183.243 +,405.0 ,5.987 ,8.077 +,399.0 ,0.338 ,415.552 +,396.0 ,5.87 ,351.817 +,379.0 ,2.35 ,56.622 +,310.0 ,5.833 ,145.631 +,300.0 ,5.644 ,22.091 +,294.0 ,5.839 ,39.618 +,252.0 ,1.637 ,221.376 +,249.0 ,4.746 ,225.829 +,239.0 ,2.35 ,137.033 +,224.0 ,0.516 ,84.343 +,223.0 ,2.843 ,0.261 +,220.0 ,1.922 ,67.668 +,217.0 ,6.142 ,5.938 +,216.0 ,4.778 ,340.771 +,208.0 ,5.58 ,68.844 +,202.0 ,1.297 ,0.048 +,199.0 ,0.956 ,152.532 +,194.0 ,1.888 ,456.394 +,193.0 ,0.916 ,453.425 +,187.0 ,1.319 ,0.16 +,182.0 ,3.536 ,79.235 +,173.0 ,1.539 ,160.609 +,172.0 ,5.68 ,219.891 +,170.0 ,3.677 ,5.417 +,169.0 ,5.879 ,18.159 +,165.0 ,1.424 ,106.977 +,163.0 ,3.05 ,112.915 +,158.0 ,0.738 ,54.175 +,147.0 ,1.263 ,59.804 +,143.0 ,1.3 ,35.425 +,139.0 ,5.386 ,32.195 +,139.0 ,4.26 ,909.819 +,124.0 ,1.374 ,7.114 +,110.0 ,2.027 ,554.07 +,109.0 ,5.706 ,77.963 +,104.0 ,5.028 ,0.751 +,104.0 ,1.458 ,24.379 +,103.0 ,0.681 ,14.978 +}; + +double uranusL1[]={57.0 +,7502543122.0 ,0.0 ,0.0 +,154458.0 ,5.242017 ,74.781599 +,24456.0 ,1.71256 ,1.48447 +,9258.0 ,0.4284 ,11.0457 +,8266.0 ,1.5022 ,63.7359 +,7842.0 ,1.3198 ,149.5632 +,3899.0 ,0.4648 ,3.9322 +,2284.0 ,4.1737 ,76.2661 +,1927.0 ,0.5301 ,2.9689 +,1233.0 ,1.5863 ,70.8494 +,791.0 ,5.436 ,3.181 +,767.0 ,1.996 ,73.297 +,482.0 ,2.984 ,85.827 +,450.0 ,4.138 ,138.517 +,446.0 ,3.723 ,224.345 +,427.0 ,4.731 ,71.813 +,354.0 ,2.583 ,148.079 +,348.0 ,2.454 ,9.561 +,317.0 ,5.579 ,52.69 +,206.0 ,2.363 ,2.448 +,189.0 ,4.202 ,56.622 +,184.0 ,0.284 ,151.048 +,180.0 ,5.684 ,12.53 +,171.0 ,3.001 ,78.714 +,158.0 ,2.909 ,0.963 +,155.0 ,5.591 ,4.453 +,154.0 ,4.652 ,35.164 +,152.0 ,2.942 ,77.751 +,143.0 ,2.59 ,62.251 +,121.0 ,4.148 ,127.472 +,116.0 ,3.732 ,65.22 +,102.0 ,4.188 ,145.631 +,102.0 ,6.034 ,0.112 +,88.0 ,3.99 ,18.16 +,88.0 ,6.16 ,202.25 +,81.0 ,2.64 ,22.09 +,72.0 ,6.05 ,70.33 +,69.0 ,4.05 ,77.96 +,59.0 ,3.7 ,67.67 +,47.0 ,3.54 ,351.82 +,44.0 ,5.91 ,7.11 +,43.0 ,5.72 ,5.42 +,39.0 ,4.92 ,222.86 +,36.0 ,5.9 ,33.68 +,36.0 ,3.29 ,8.08 +,36.0 ,3.33 ,71.6 +,35.0 ,5.08 ,38.13 +,31.0 ,5.62 ,984.6 +,31.0 ,5.5 ,59.8 +,31.0 ,5.46 ,160.61 +,30.0 ,1.66 ,447.8 +,29.0 ,1.15 ,462.02 +,29.0 ,4.52 ,84.34 +,27.0 ,5.54 ,131.4 +,27.0 ,6.15 ,299.13 +,26.0 ,4.99 ,137.03 +,25.0 ,5.74 ,380.13 +}; + +double uranusL2[]={35.0 +,53033.0 ,0.0 ,0.0 +,2358.0 ,2.2601 ,74.7816 +,769.0 ,4.526 ,11.046 +,552.0 ,3.258 ,63.736 +,542.0 ,2.276 ,3.932 +,529.0 ,4.923 ,1.484 +,258.0 ,3.691 ,3.181 +,239.0 ,5.858 ,149.563 +,182.0 ,6.218 ,70.849 +,54.0 ,1.44 ,76.27 +,49.0 ,6.03 ,56.62 +,45.0 ,3.91 ,2.45 +,45.0 ,0.81 ,85.83 +,38.0 ,1.78 ,52.69 +,37.0 ,4.46 ,2.97 +,33.0 ,0.86 ,9.56 +,29.0 ,5.1 ,73.3 +,24.0 ,2.11 ,18.16 +,22.0 ,5.99 ,138.52 +,22.0 ,4.82 ,78.71 +,21.0 ,2.4 ,77.96 +,21.0 ,2.17 ,224.34 +,17.0 ,2.54 ,145.63 +,17.0 ,3.47 ,12.53 +,12.0 ,0.02 ,22.09 +,11.0 ,0.08 ,127.47 +,10.0 ,5.16 ,71.6 +,10.0 ,4.46 ,62.25 +,9.0 ,4.26 ,7.11 +,8.0 ,5.5 ,67.67 +,7.0 ,1.25 ,5.42 +,6.0 ,3.36 ,447.8 +,6.0 ,5.45 ,65.22 +,6.0 ,4.52 ,151.05 +,6.0 ,5.73 ,462.02 +}; + +double uranusL3[]={18.0 +,121.0 ,0.024 ,74.782 +,68.0 ,4.12 ,3.93 +,53.0 ,2.39 ,11.05 +,46.0 ,0.0 ,0.0 +,45.0 ,2.04 ,3.18 +,44.0 ,2.96 ,1.48 +,25.0 ,4.89 ,63.74 +,21.0 ,4.55 ,70.85 +,20.0 ,2.31 ,149.56 +,9.0 ,1.58 ,56.62 +,4.0 ,0.23 ,18.16 +,4.0 ,5.39 ,76.27 +,4.0 ,0.95 ,77.96 +,3.0 ,4.98 ,85.83 +,3.0 ,4.13 ,52.69 +,3.0 ,0.37 ,78.71 +,2.0 ,0.86 ,145.63 +,2.0 ,5.66 ,9.56 +}; + +double uranusL4[]={4.0 +,114.0 ,3.142 ,0.0 +,6.0 ,4.58 ,74.78 +,3.0 ,0.35 ,11.05 +,1.0 ,3.42 ,56.62 +}; + +double uranusB0[]={28.0 +,1346278.0 ,2.6187781 ,74.7815986 +,62341.0 ,5.08111 ,149.5632 +,61601.0 ,3.14159 ,0.0 +,9964.0 ,1.616 ,76.2661 +,9926.0 ,0.5763 ,73.2971 +,3259.0 ,1.2612 ,224.3448 +,2972.0 ,2.2437 ,1.4845 +,2010.0 ,6.0555 ,148.0787 +,1522.0 ,0.2796 ,63.7359 +,924.0 ,4.038 ,151.048 +,761.0 ,6.14 ,71.813 +,522.0 ,3.321 ,138.517 +,463.0 ,0.743 ,85.527 +,437.0 ,3.381 ,529.691 +,435.0 ,0.341 ,77.751 +,431.0 ,3.554 ,213.299 +,420.0 ,5.213 ,11.046 +,245.0 ,0.788 ,2.969 +,233.0 ,2.257 ,222.86 +,216.0 ,1.591 ,38.133 +,180.0 ,3.725 ,299.126 +,175.0 ,1.236 ,146.594 +,174.0 ,1.937 ,380.128 +,160.0 ,5.336 ,111.43 +,144.0 ,5.962 ,35.164 +,116.0 ,5.739 ,70.849 +,106.0 ,0.941 ,70.328 +,102.0 ,2.619 ,78.714 +}; + +double uranusB1[]={20.0 +,206366.0 ,4.123943 ,74.781599 +,8563.0 ,0.3382 ,149.5632 +,1726.0 ,2.1219 ,73.2971 +,1374.0 ,0.0 ,0.0 +,1369.0 ,3.0686 ,76.2661 +,451.0 ,3.777 ,1.484 +,400.0 ,2.848 ,224.345 +,307.0 ,1.255 ,148.079 +,154.0 ,3.786 ,63.736 +,112.0 ,5.573 ,151.048 +,111.0 ,5.329 ,138.517 +,83.0 ,3.59 ,71.81 +,56.0 ,3.4 ,85.83 +,54.0 ,1.7 ,77.75 +,42.0 ,1.21 ,11.05 +,41.0 ,4.45 ,78.71 +,32.0 ,3.77 ,222.86 +,30.0 ,2.56 ,2.97 +,27.0 ,5.34 ,213.3 +,26.0 ,0.42 ,380.13 +}; + +double uranusB2[]={11.0 +,9212.0 ,5.8004 ,74.7816 +,557.0 ,0.0 ,0.0 +,286.0 ,2.177 ,149.563 +,95.0 ,3.84 ,73.3 +,45.0 ,4.88 ,76.27 +,20.0 ,5.46 ,1.48 +,15.0 ,0.88 ,138.52 +,14.0 ,2.85 ,148.08 +,14.0 ,5.07 ,63.74 +,10.0 ,5 ,224.34 +,8.0 ,6.27 ,78.71 +}; + +double uranusB3[]={4.0 +,268.0 ,1.251 ,74.782 +,11.0 ,3.14 ,0.0 +,6.0 ,4.01 ,149.56 +,3.0 ,5.78 ,73.3 +}; + +double uranusB4[]={1.0 +,6.0 ,2.85 ,74.78 +}; + +double uranusR0[]={59.0 +,1921264848.0 ,0.0 ,0.0 +,88784984.0 ,5.60377527 ,74.78159857 +,3440836.0 ,0.328361 ,73.2971259 +,2055653.0 ,1.7829517 ,149.5631971 +,649322.0 ,4.522473 ,76.266071 +,602248.0 ,3.860038 ,63.735898 +,496404.0 ,1.401399 ,454.909367 +,338526.0 ,1.580027 ,138.517497 +,243508.0 ,1.570866 ,71.812653 +,190522.0 ,1.998094 ,1.484473 +,161858.0 ,2.791379 ,148.078724 +,143706.0 ,1.383686 ,11.0457 +,93192.0 ,0.17437 ,36.64856 +,89806.0 ,3.66105 ,109.94569 +,71424.0 ,4.24509 ,224.3448 +,46677.0 ,1.39977 ,35.16409 +,39026.0 ,3.36235 ,277.03499 +,39010.0 ,1.66971 ,70.84945 +,36755.0 ,3.88649 ,146.59425 +,30349.0 ,0.701 ,151.04767 +,29156.0 ,3.18056 ,77.75054 +,25786.0 ,3.78538 ,85.8273 +,25620.0 ,5.25656 ,380.12777 +,22637.0 ,0.72519 ,529.69097 +,20473.0 ,2.7964 ,70.32818 +,20472.0 ,1.55589 ,202.2534 +,17901.0 ,0.55455 ,2.96895 +,15503.0 ,5.35405 ,38.13304 +,14702.0 ,4.90434 ,108.46122 +,12897.0 ,2.62154 ,111.43016 +,12328.0 ,5.96039 ,127.4718 +,11959.0 ,1.75044 ,984.60033 +,11853.0 ,0.99343 ,52.6902 +,11696.0 ,3.29826 ,3.92315 +,11495.0 ,0.43774 ,65.22037 +,10793.0 ,1.42105 ,213.2991 +,9111.0 ,4.9964 ,62.2514 +,8421.0 ,5.2535 ,222.8603 +,8402.0 ,5.0388 ,415.5525 +,7449.0 ,0.7949 ,351.8166 +,7329.0 ,3.9728 ,183.2428 +,6046.0 ,5.6796 ,78.7138 +,5524.0 ,3.115 ,9.5612 +,5445.0 ,5.1058 ,145.1098 +,5238.0 ,2.6296 ,33.6796 +,4079.0 ,3.2206 ,340.7709 +,3919.0 ,4.2502 ,39.6175 +,3802.0 ,6.1099 ,184.7273 +,3781.0 ,3.4584 ,456.3938 +,3687.0 ,2.4872 ,453.4249 +,3102.0 ,4.1403 ,219.8914 +,2963.0 ,0.8298 ,56.6224 +,2942.0 ,0.4239 ,299.1264 +,2940.0 ,2.1464 ,137.033 +,2938.0 ,3.6766 ,140.002 +,2865.0 ,0.31 ,12.5302 +,2538.0 ,4.8546 ,131.4039 +,2364.0 ,0.4425 ,554.07 +,2183.0 ,2.9404 ,305.3462 +}; + +double uranusR1[]={35.0 +,1479896.0 ,3.6720571 ,74.7815986 +,71212.0 ,6.22601 ,63.7359 +,68627.0 ,6.13411 ,149.5632 +,24060.0 ,3.14159 ,0.0 +,21468.0 ,2.60177 ,76.26607 +,20857.0 ,5.24625 ,11.0457 +,11405.0 ,0.01848 ,70.84945 +,7497.0 ,0.4236 ,73.2971 +,4244.0 ,1.4169 ,85.8273 +,3927.0 ,3.1551 ,71.8127 +,3578.0 ,2.3116 ,224.3448 +,3506.0 ,2.5835 ,138.5175 +,3229.0 ,5.255 ,3.9322 +,3060.0 ,0.1532 ,1.4845 +,2564.0 ,0.9808 ,148.0787 +,2429.0 ,3.9944 ,52.6902 +,1645.0 ,2.6535 ,127.4718 +,1584.0 ,1.4305 ,78.7138 +,1508.0 ,5.06 ,151.0477 +,1490.0 ,2.6756 ,56.6224 +,1413.0 ,4.5746 ,202.2534 +,1403.0 ,1.3699 ,77.7505 +,1228.0 ,1.047 ,62.2514 +,1033.0 ,0.2646 ,131.4039 +,992.0 ,2.172 ,65.22 +,862.0 ,5.055 ,351.817 +,744.0 ,3.076 ,35.164 +,687.0 ,2.499 ,77.963 +,647.0 ,4.473 ,70.328 +,624.0 ,0.863 ,9.561 +,604.0 ,0.907 ,984.6 +,575.0 ,3.231 ,447.796 +,562.0 ,2.718 ,462.023 +,530.0 ,5.917 ,213.299 +,528.0 ,5.151 ,2.969 +}; + +double uranusR2[]={18.0 +,22440.0 ,0.69953 ,74.7816 +,4727.0 ,1.699 ,63.7359 +,1682.0 ,4.6483 ,70.8494 +,1650.0 ,3.0966 ,11.0457 +,1434.0 ,3.5212 ,149.5632 +,770.0 ,0.0 ,0.0 +,500.0 ,6.172 ,76.266 +,461.0 ,0.767 ,3.932 +,390.0 ,4.496 ,56.622 +,390.0 ,5.527 ,85.827 +,292.0 ,0.204 ,52.69 +,287.0 ,3.534 ,73.297 +,273.0 ,3.847 ,138.517 +,220.0 ,1.964 ,131.404 +,216.0 ,0.848 ,77.963 +,205.0 ,3.248 ,78.714 +,149.0 ,4.898 ,127.472 +,129.0 ,2.081 ,3.181 +}; + +double uranusR3[]={10.0 +,1164.0 ,4.7345 ,74.7816 +,212.0 ,3.343 ,63.736 +,196.0 ,2.98 ,70.849 +,105.0 ,0.958 ,11.046 +,73.0 ,1 ,149.56 +,72.0 ,0.03 ,56.62 +,55.0 ,2.59 ,3.93 +,36.0 ,5.65 ,77.96 +,34.0 ,3.82 ,76.27 +,32.0 ,3.6 ,131.4 +}; + +double uranusR4[]={2.0 +,53.0 ,3.01 ,74.78 +,10.0 ,1.91 ,56.62 +}; + +double neptuneL0[]={38.0 +,531188633.0 ,0.0 ,0.0 +,1798476.0 ,2.9010127 ,38.1330356 +,1019728.0 ,0.4858092 ,1.4844727 +,124532.0 ,4.830081 ,36.648563 +,42064.0 ,5.41055 ,2.96895 +,37715.0 ,6.09222 ,35.16409 +,33785.0 ,1.24489 ,76.26607 +,16483.0 ,8e-05 ,491.55793 +,9199.0 ,4.9375 ,39.6175 +,8994.0 ,0.2746 ,175.1661 +,4216.0 ,1.9871 ,73.2971 +,3365.0 ,1.0359 ,33.6796 +,2285.0 ,4.2061 ,4.4534 +,1434.0 ,2.7834 ,74.7816 +,900.0 ,2.076 ,109.946 +,745.0 ,3.19 ,71.813 +,506.0 ,5.748 ,114.399 +,400.0 ,0.35 ,1021.249 +,345.0 ,3.462 ,41.102 +,340.0 ,3.304 ,77.751 +,323.0 ,2.248 ,32.195 +,306.0 ,0.497 ,0.521 +,287.0 ,4.505 ,0.048 +,282.0 ,2.246 ,146.594 +,267.0 ,4.889 ,0.963 +,252.0 ,5.782 ,388.465 +,245.0 ,1.247 ,9.561 +,233.0 ,2.505 ,137.033 +,227.0 ,1.797 ,453.425 +,170.0 ,3.324 ,108.461 +,151.0 ,2.192 ,33.94 +,150.0 ,2.997 ,5.938 +,148.0 ,0.859 ,111.43 +,119.0 ,3.677 ,2.448 +,109.0 ,2.416 ,183.243 +,103.0 ,0.041 ,0.261 +,103.0 ,4.404 ,70.328 +,102.0 ,5.705 ,0.112 +}; + +double neptuneL1[]={18.0 +,3837687717.0 ,0.0 ,0.0 +,16604.0 ,4.86319 ,1.48447 +,15807.0 ,2.27923 ,38.13304 +,3335.0 ,3.682 ,76.2661 +,1306.0 ,3.6732 ,2.9689 +,605.0 ,1.505 ,35.164 +,179.0 ,3.453 ,39.618 +,107.0 ,2.451 ,4.453 +,106.0 ,2.755 ,33.68 +,73.0 ,5.49 ,36.65 +,57.0 ,1.86 ,114.4 +,57.0 ,5.22 ,0.52 +,35.0 ,4.52 ,74.78 +,32.0 ,5.9 ,77.75 +,30.0 ,3.67 ,388.47 +,29.0 ,5.17 ,9.56 +,29.0 ,5.17 ,2.45 +,26.0 ,5.25 ,168.05 +}; + +double neptuneL2[]={7.0 +,53893.0 ,0.0 ,0.0 +,296.0 ,1.855 ,1.484 +,281.0 ,1.191 ,38.133 +,270.0 ,5.721 ,76.266 +,23.0 ,1.21 ,2.97 +,9.0 ,4.43 ,35.16 +,7.0 ,0.54 ,2.45 +}; + +double neptuneL3[]={4.0 +,31.0 ,0.0 ,0.0 +,15.0 ,1.35 ,76.27 +,12.0 ,6.04 ,1.48 +,12.0 ,6.11 ,38.13 +}; + +double neptuneL4[]={1.0 +,114.0 ,3.142 ,0.0 +}; + +double neptuneB0[]={17.0 +,3088623.0 ,1.4410437 ,38.1330356 +,27780.0 ,5.91272 ,76.26607 +,27624.0 ,0.0 ,0.0 +,15448.0 ,3.50877 ,39.61751 +,15355.0 ,2.52124 ,36.64856 +,2000.0 ,1.51 ,74.7816 +,1968.0 ,4.3778 ,1.4845 +,1015.0 ,3.2156 ,35.1641 +,606.0 ,2.802 ,73.297 +,595.0 ,2.129 ,41.102 +,589.0 ,3.187 ,2.969 +,402.0 ,4.169 ,114.399 +,280.0 ,1.682 ,77.751 +,262.0 ,3.767 ,213.299 +,254.0 ,3.271 ,453.425 +,206.0 ,4.257 ,529.691 +,140.0 ,3.53 ,137.033 +}; + +double neptuneB1[]={13.0 +,227279.0 ,3.807931 ,38.133036 +,1803.0 ,1.9758 ,76.2661 +,1433.0 ,3.1416 ,0.0 +,1386.0 ,4.8256 ,36.6486 +,1073.0 ,6.0805 ,39.6175 +,148.0 ,3.858 ,74.782 +,136.0 ,0.478 ,1.484 +,70.0 ,6.19 ,35.16 +,52.0 ,5.05 ,73.3 +,43.0 ,0.31 ,114.4 +,37.0 ,4.89 ,41.1 +,37.0 ,5.76 ,2.97 +,26.0 ,5.22 ,213.3 +}; + +double neptuneB2[]={6.0 +,9691.0 ,5.5712 ,38.133 +,79.0 ,3.63 ,76.27 +,72.0 ,0.45 ,36.65 +,59.0 ,3.14 ,0.0 +,30.0 ,1.61 ,39.62 +,6.0 ,5.61 ,74.78 +}; + +double neptuneB3[]={4.0 +,273.0 ,1.017 ,38.133 +,2.0 ,0.0 ,0.0 +,2.0 ,2.37 ,36.65 +,2.0 ,5.33 ,76.27 +}; + +double neptuneB4[]={1.0 +,6.0 ,2.67 ,38.13 +}; + +double neptuneR0[]={32.0 +,3007013206.0 ,0.0 ,0.0 +,27062259.0 ,1.32999459 ,38.13303564 +,1691764.0 ,3.2518614 ,36.6485629 +,807831.0 ,5.185928 ,1.484473 +,537761.0 ,4.521139 ,35.16409 +,495726.0 ,1.571057 ,491.557929 +,274572.0 ,1.845523 ,175.16606 +,135134.0 ,3.372206 ,39.617508 +,121802.0 ,5.797544 ,76.266071 +,100895.0 ,0.377027 ,73.297126 +,69792.0 ,3.79617 ,2.96895 +,46688.0 ,5.74938 ,33.67962 +,24594.0 ,0.50802 ,109.94569 +,16939.0 ,1.59422 ,71.81265 +,14230.0 ,1.07786 ,74.7816 +,12012.0 ,1.92062 ,1021.24889 +,8395.0 ,0.6782 ,146.5943 +,7572.0 ,1.0715 ,388.4652 +,5721.0 ,2.5906 ,4.4534 +,4840.0 ,1.9069 ,41.102 +,4483.0 ,2.9057 ,529.691 +,4421.0 ,1.7499 ,108.4612 +,4354.0 ,0.6799 ,32.1951 +,4270.0 ,3.4134 ,453.4249 +,3381.0 ,0.8481 ,183.2428 +,2881.0 ,1.986 ,137.033 +,2879.0 ,3.6742 ,350.3321 +,2636.0 ,3.0976 ,213.2991 +,2530.0 ,5.7984 ,490.0735 +,2523.0 ,0.4863 ,493.0424 +,2306.0 ,2.8096 ,70.3282 +,2087.0 ,0.6186 ,33.9402 +}; + +double neptuneR1[]={15.0 +,236339.0 ,0.70498 ,38.133036 +,13220.0 ,3.32015 ,1.48447 +,8622.0 ,6.2163 ,35.1641 +,2702.0 ,1.8814 ,39.6175 +,2155.0 ,2.0943 ,2.9689 +,2153.0 ,5.1687 ,76.2661 +,1603.0 ,0.0 ,0.0 +,1464.0 ,1.1842 ,33.6796 +,1136.0 ,3.9189 ,36.6486 +,898.0 ,5.241 ,388.465 +,790.0 ,0.533 ,168.053 +,760.0 ,0.021 ,182.28 +,607.0 ,1.077 ,1021.249 +,572.0 ,3.401 ,484.444 +,561.0 ,2.887 ,498.671 +}; + +double neptuneR2[]={5.0 +,4247.0 ,5.8991 ,38.133 +,218.0 ,0.346 ,1.484 +,163.0 ,2.239 ,168.053 +,156.0 ,4.594 ,182.28 +,127.0 ,2.848 ,35.164 +}; + +double neptuneR3[]={1.0 +,166.0 ,4.552 ,38.133 +}; +