.TH attraction "" "" "X Application"
.PC "Display interactions of opposing forces"
.fi
\fBattraction
[\-background \fIcolor\fB]
[\-color-mode cycle | random]
[\-color-shift \fIdegrees\fB]
[\-delay \fIusecs\fB]
[\-display \fIhost:display.screen\fB]
[\-foreground \fIcolor\fB]
[\-glow]
[\-mode balls | lines | polygons | splines | filled-splines | tails ]
[\-mono]
[\-noglow]
[\-orbit]
[\-points \fIint\fB]
[\-radius \fIint\fB]
[\-root]
[\-segments \fIint\fB]
[\-size \fIint\fB]
[\-threshold \fIint\fB]
[\-vx \fIint\fB]
[\-vy \fIint\fB]
[\-window]\fR
.PP
.B attraction
graphically displays the interaction of attractive and repulsive forces.
It displaying several objects in the window,
each of which has both an attractive and repulsive force.
The attractive force has a long range, the repulsive force has a short range.
When objects are far apart, they are drawn to one another; but as they
approach closely to each other, the repulsive force grows greater.
As a result, the objects dance around the window in a random, attractive
pattern.
.PP
.B attraction
recognizes the following command-line options:
.IP "\fB\-color-mode [cycle | random]\fR"
This sets the way
.B attraction
selects colors:
.B cycle
tells it to cycle through the spectrum, whereas
.B random
tells it to pick them randomly.
.IP "\fB\-color-shift \fIdegrees\fR"
If you run
.B attraction
on a color display, it cycles the color of the line segments or polygons
through the spectrum.
This option sets to
.I degrees
on the HSV wheel how far the hue of a segment
varies from that of the previously drawn segment.
The default is three.
This option has no effect in
.B balls
mode.
.IP "\fB\-delay \fImicroseconds\fR"
Set to
.I microseconds
the amount of delay between steps of the animation.
The default is 10,000 \(em that is, about 0.01 seconds.
.IP \fB\-glow\fR
If
.B attraction
is running in
.B balls
mode, this option tells it
to change the saturation of the color of each control point
to reflect its acceleration.
This means that balls flare brighter
when they are reacting to each other most strongly.
.IP
In
.I glow
mode,
.B attraction
draws all of the balls in the same, randomly selected
color modulo the saturation shifts.
In non-glow mode, it draws the balls in a random color that does not change.
.IP "\fB\-mode [balls | lines | polygons | tails | splines | filled-splines]\fR"
This sets the mode in which
the game runs.
.B attraction
recognizes the following modes:
.RS
.IP \fBballs\fR
The control points are filled circles:
the larger the circle, the more massive the particle.
.IP \fBlines\fR
The control points are connected by straight lines;
the effect is something like that seen with
.BR qix .
.IP \fBpolygons\fR
The control points are connected by straight lines and filled in.
This is most interesting in color.
.IP \fBsplines\fR
A closed spline is interpolated from the control points.
.IP \fBfilled-splines\fR
The splines are filled in instead of being outlines.
This is most interesting in color.
.IP \fBtails\fR
.B attraction
draws the path that each particle as a worm-like trail,
whose length is controlled by the command-line option
.BR segments .
.RE
.IP \fB\-mono\fR
Use only black and white, even if run on a color display.
.IP \fB\-noglow\fR
Do not do ``glow'' the balls.
This is the default.
.IP \fB\-orbit\fR
Make the initial force on each ball to be tangential to the circle on which
they are initially placed,
with the right velocity to hold them in orbit about each other.
Over time, rounding errors will cause the orbit to decay.
.IP "\fB\-points \fIinteger\fR"
Use
.I integer
control points (i.e., objects).
The default is zero, which selects the number randomly.
For best results, use a value between three and 15.
.IP "\fB\-radius \fIpixels\fR"
Set to
.I pixels
the size of the circle on which the objects are initially positioned.
The default is slightly smaller than the size of the window.
.IP \fB\-root\fR
Draw the game on the root window.
.IP "\fB\-size \fIpixels\fR"
Set to
.I pixels
the size (that is, the massiveness) of each ball.
The default is zero, which tells
.B attraction
to select the sizes randomly.
.IP "\fB\-segments \fIinteger\fR"
If you are running
.B attraction
in
.B lines
or
.B polygons
mode, this option set to
.I integer
the number of sets of line segments or polygons it should draw.
The default is 100.
This has no effect in
.B balls
mode.
Settings
.B segments
to zero tells
.B attraction
never to erase a segment.
.IP "\fB\-threshold \fIpixels\fR"
Set to
.I pixels
the distance at which the repulsive force overwhelms the attractive force.
The default is 100 pixels.
.IP "\fB\-vmult \fIfloat\fR"
In orbit mode, multiply the initial velocity of the balls by
.IR float .
If
.I float
is less than one,
it makes the balls pull together more closly; a value larger than one
makes them move apart.
The default is one, which mean stability.
.IP "\fB\-vx \fIpixels\fR"
.IS "\fB\-vy \fIpixels\fR"
Set the initial velocity of the balls on the X/Y grid, in pixels.
This has no effect in
.B \-orbit
mode.
.IP \fB\-window\fR
Draw the game on a newly-created window.
This is the default.
.SH Environment
.B attraction
uses the following environmental variables:
.IP \fBDISPLAY\fR
The default host and display number.
.IP \fBXENVIRONMENT\fR
The name of a resource file that overrides the global resources
stored in the property
.BR RESOURCE_MANAGER .
.SH "See Also"
.B
X,
xscreensaver
.R
.SH Notes
.B attraction
was written by
Jamie Zawinski (jwz@lucid.com).
.PP
Copyright \(co 1992, 1993 by Jamie Zawinski.
Permission to use, copy, modify,
distribute, and sell this software and its documentation for any purpose is
hereby granted without fee, provided that the above copyright notice appear
in all copies and that both that copyright notice and this permission notice
appear in supporting documentation.
No representations are made about the
suitability of this software for any purpose.
It is provided ``as is'' without express or implied warranty.
