home *** CD-ROM | disk | FTP | other *** search
- 10-OCT-1987
-
-
- Well, here it is! (Finally) This version can accept all options
- and parameters from the command line. Also, the first body (the sun)
- is not necessarily nailed to the cosmos. By that I mean that the
- first body can be allowed to gain velocity just like the other bodies.
- The previous version never allowed the first body to accumulate
- velocity. When the first body isn't fixed, the tracking function can
- be used to "follow" it keeping it centered on the screen. This should
- provide a more accurate simulation than the previous version. Any
- data files must be modified to include position and velocity values
- for the first body. The load, save and edit functions are not yet
- working in this version. The program is still "public domain" and
- may be freely distributed.
-
- Pete
-
- Command line:
-
- > GRAVITY -<option> -<option> ... -<option>
-
- Some option may be followed by a value
-
- Option Description Value Default
-
- T Title Bar Display title
- R Trails Display trails
- H High Resolution Not high resolution
- X Fixed First Body First body fixed
- A Track First Body First body not tracked
- E Timeout (seconds) * No timeout
- F File Name * "Gravity.Dat"
-
-
-
- Examples:
-
- > gravity -t -h (hide title, use high resolution)
- > gravity -x -a -e 20 (movable first body, tracking first
- body, timeout in 20 seconds)
- > gravity -f gravity3.dat (use data file "gravity2.dat")
- > gravity -t -e 200 -f example_file (hide title, timeout in 200 seconds,
- use data file "example_file")
-
-
- /*
- * Gravity V3.0 July 29, 1987
- *
- * This program simulates planets in orbit around a star.
- * See "Computer Recreations"
- * SCIENTIFIC AMERICAN, January 1986.
- *
- * Data file format:
- *
- * (The (0,0) point is at the center of the screen.)
- * Input format (all float values) :
- * Gravitation Constant, Time Step, Display Scale
- * X Pos P1, Y Pos P1, X Vel P1, Y Vel P1, Mass P1
- * X Pos P2, Y Pos P2, X Vel P2, Y Vel P2, Mass P2
- * X Pos P3, Y Pos P3, X Vel P3, Y Vel P3, Mass P3
- * . . .
- *
- *
- * Author:
- * Peter A. Giancola CompuServ ID: 76337,2542
- * 8005 Mandan Road #101
- * Greenbelt, Maryland 20770-2156
- * (301) 345-0118
- */
-