# Epitrochoid

Back to documentation index.

Augments: Curve

A curve evaluator object for a curve drawn by a circle that rolls along the outside of another circle, whose position is fixed, with a center of (0,0). The rolling circle will start at the positive X axis of the fixed circle.

The following curves can be generated with this class (in the following descriptions, O = `outerRadius`, R means `rollerRadius`, and D = `distFromRollerCenter`).

• Epicycloid: D = R (epitrochoid touching the fixed circle).
• Curtate epicycloid: D < R (epitrochoid not touching the fixed circle).
• Prolate epicycloid: D > R (epitrochoid crossing the fixed circle).
• Cardioid: R = O; D = O.
• Nephroid: R = O/2; D = O/2.
• Ranunculoid: R = O/5; D = O/5.
• N-cusped epicycloid: R = O/N; D = O/N.
• Circle: O = 0; the radius will be R - D.

This class is considered a supplementary class to the Public Domain HTML 3D Library and is not considered part of that library.

To use this class, you must include the script "extras/evaluators.js"; the class is not included in the "h3du_min.js" file which makes up the HTML 3D Library. Example:

```<script type="text/javascript" src="extras/evaluators.js"></script>
```

#### Parameters

• `outerRadius` (Type: number)
Radius of the circle whose position is fixed.
• `rollerRadius` (Type: number)
• `distFromRollerCenter` (Type: number)
Distance from the center of the rolling circle to the drawing pen.
• `rotationDegrees` (Type: number) (optional)
Starting angle of the curve from the positive X axis toward the positive Y axis, in degrees. Default is 0.

### Methods

• endPoints
Gets the endpoints of this curve.
• evaluate
Generates a point on the curve from the given U coordinate.
• scaleTo
Creates a modified version of this curve so that it fits the given radius.

### Epitrochoid#endPoints()

Gets the endpoints of this curve. For this curve evaluator object, the curve starts at 0 and ends at π*2.

#### Return Value

An array containing the two endpoints of the curve. The first number is the start of the curve, and the second number is the end of the curve. * (Type: Array.<number>)

### Epitrochoid#evaluate(u)

Generates a point on the curve from the given U coordinate.

#### Parameters

• `u` (Type: number)
U coordinate.

#### Return Value

A 3-element array specifying a 3D point. Only the X and Y coordinates will be other than 0. (Type: Array.<number>)

• `radius` (Type: number)