**epicycloid**,
a MATLAB code 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.