GALAXY(1)GALAXY(1)
NAME
galaxy, mkgalaxy – galactic n-body simulator
SYNOPSIS
DESCRIPTION
Mouse commands
Holding mouse button 1 while dragging repositions the visible region of the galaxy. Holding mouse button 2 while dragging up or down zooms the visible region of the galaxy in or out, respectively. Mouse button 3 opens a menu with the following options:
Creates a new galactic body. Holding button 1 positions the body. Holding a button 1-2 chord changes the mass/size of the body. Holding a button 1-3 chord changes the initial velocity of the body. Releasing button 1 restarts the simulator with the new body in motion. When new bodies are created, the simulator maintains the Galilean (inertial) reference frame where the center of mass of the galaxy is at rest.
Prompts for a floating point value to change the speed of the simulation. E.g. a value of 2 will double the speed of the simulation and a value of 0.5 will halve the speed. Accuracy is sacrificed for greater speed.
Prompts for a floating point value to change the gravitational constant. E.g. a value of 2 will double the force exerted by gravity and a value of 0.5 will halve it.
Prompts for a file name to save the current galaxy as a
Prompts for a file name to load the galaxy from the
Exits the simulator.
Keyboard commands
The following keys are recognized as commands:
Show accelerations as vectors.
Show velocities as vectors.
Show statistics such as the number of bodies being simulated, the maximum depth of the quad-tree, and the average number of calculations made per body.
Exit the simulator.
Pause and unpause the simulator.
Exit the simulator.
Command-line options
Certain aspects of the galaxy simulator are controlled by the following options:
Sets the gravitational constant to
Reads the galaxy file
Reads a galaxy file from standard input.
Specifies the number of extra processes to use in order
to calculate the gravitational force on each body in
parallel.
The default value is
Causes the process that calculates forces to relinquish
the processor for
Sets the
Mkgalaxy
Bodies have the given
Bodies have the given
Bodies have the given
The entire galaxy being generated is given the directional velocity determined
by the vector
The entire galaxy being generated is offset by the vector
The galaxy being generated is a square. Without this option, the galaxy will be circular.
The arguments to the
EXAMPLES
Two rotating circles destroy each other:
games/mkgalaxy -av 100 -d 60±50 -v 10 2000 | games/mkgalaxy -i -av -70 -d 80±50 -v 10 -o 6000,2000 -gv -80,40 3000 | games/galaxy -i
Cool patterns made by a square galaxy:
games/mkgalaxy -sq -av 20 5000 | games/galaxy -i
SOURCE
SEE
J. Barnes & P. Hut (December 1986). "A hierarchical O(N log N) force-calculation algorithm".