Dec 232017
 
Demo of using cyclic functions with Fast Graphics.
File FGCYCL10.ZIP from The Programmer’s Corner in
Category Miscellaneous Language Source Code
Demo of using cyclic functions with Fast Graphics.
File Name File Size Zip Size Zip Type
CYCLOIDS.C 4412 1064 deflated
CYCLOIDS.DOC 2030 929 deflated
CYCLOIDS.EXE 31462 19560 deflated
CYCLOIDS.H 199 99 deflated

Download File FGCYCL10.ZIP Here

Contents of the CYCLOIDS.DOC file


CYCLOIDS.C was written by Diana Gruber to show how to use Fastgraph
to graph a mathematical function. The function is the epicycloid,
also known as the "Spirograph" (tm) function. A pattern is created
by plotting 4 epicycloids on the screen, and the pattern is repeated
3 times, with a pause for a keystroke in between.

The first time the epicycloids are drawn, the world space coordinate
system is defined to range from -5.0 to 5.0 in the horizontal
direction, and -4.0 to 4.0 in the vertical direction. This corrects
for the aspect ratio of most monitors, and the pattern should appear
to be roughly circular, with the origin at the center of the screen.

The second time the design is drawn, world space is redefined to
range from -10.0 to 10.0 horizontally, and -8.0 to 8.0 vertically.
The pattern looks smaller, and more of it will fit on the screen.
Fastgraph clips the lines at the edge of the screen.

The third time the design is drawn, world space ranges from -5.0 to
5.0 horizontally and -8.0 to 8.0 vertically. The pattern no longer
appears to be circular.

Note that it takes the same amount of time to plot the epicycloids
no matter what size they are. The time delay is in the mathematical
calculations, not in the drawing function. The program will run
faster on a computer with a math coprocessor chip. We noticed that
it runs much faster on a 12 MHz 80286 with a math coprocessor chip
than on a 25 MHz 80386 without a math coprocessor.

You can modify and use any part of this source code. This program
will not link with Fastgraph/Light; it requires the professional
version of Fastgraph.

Zipfile name: FGCYCL10.ZIP

Files in the distribution:

CYCLOIDS.EXE -- executable program
CYCLOIDS.C -- source code
CYCLOIDS.H -- function prototypes
CYCLOIDS.DOC -- this file

You can download the latest evaluation version of Fastgraph/Light from
DDBBS at (702) 796-7134. The phone number for Fastgraph voice support
is (702) 735-1980.



 December 23, 2017  Add comments

Leave a Reply