Compute, Plot, and Tabulate an Epicycloid Curve

**EPICYCLOID**
is a MATLAB library which
computes, plots and tabulates an epicycloid curve.

An epicycloid is the curve traced by a point on the perimeter of a circle of radius r1 which is rolling around the perimeter of a a circle of radius r2. Normally, r1 is smaller than r2.

The equations for the (x,y) coordinates of the point are:

x(t) = (r1+r2) * cos(t) - r1 * cos ( (r1+r2)*t/r1 ) y(t) = (r1+r2) * sin(t) - r1 * sin ( (r1+r2)*t/r2 )It is usual to write k = r2/r1. If k is an integer, then the curve is closed, and has k cusps. If k is rational, and in lowest terms is p/q, then it has p cusps. Otherwise, if k is irrational, then mathematically the curve is not closed, and fills the annulus of radiuses r2 and r2+r1.

To use the programs, you specify:

- k, the ratio r2/r1,
- s, the number of times the small circle should roll around the big one
- n, the number of points to compute.

The computer code and data files made available on this web page are distributed under the GNU LGPL license.

**EPICYCLOID** is available in
a MATLAB version.

- epicycloid_plot.m, plots points along an epicycloid.
- epicycloid_rt.m, computes (r,t) points along an epicycloid.
- epicycloid_xy.m, computes XY points along an epicycloid.
- r8vec2_print_some.m, prints "some" of an R8VEC2.
- r8vec2_write.m, writes an R8VEC2 file.
- timestamp.m, prints the current YMDHMS date as a time stamp.

- epicycloid_test.m, calls all the tests;
- epicycloid_test_output.txt, the output file.
- epicycloid.png, a plot of an epicycloid.
- epicycloid_rt.txt, the (r,t) coordinates of 501 points on the epicycloid.
- epicycloid_xy.txt, the (x,y) coordinates of 501 points on the epicycloid.

You can go up one level to the MATLAB source codes.