# Hypotrochoid

Back to documentation index.

Augments: Curve

A curve evaluator object for a curve drawn by a circle that rolls along the inside of another circle, whose position is fixed, with a center of (0,0).

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

• Hypocycloid: D = R (hypotrochoid touching the fixed circle).
• Curtate hypocycloid: D < R (hypotrochoid not touching the fixed circle).
• Prolate hypocycloid: D > R (hypotrochoid crossing the fixed circle).
• Circle: O = R*2; the circle will have radius R - D.
• Ellipse: O = R*2; the ellipse (unrotated) will have width abs(R+D)*2 and height abs(R-D)*2.
• Line segment with length O*2: O = R*2; D = R.
• Deltoid: O = R*3; D = R.
• Astroid: O = R*4; D = R.
• N-pointed hypocycloid: O = R * N; D = R.

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.
• `innerRadius` (Type: number)
• `distFromInnerCenter` (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

• arcLength
Finds an approximate arc length (distance) between the start of this curve and the point at the given U coordinate of this curve.
• endPoints
Gets the endpoints of this curve.
• evaluate
Finds the coordinates of a point on the curve from the given U coordinate.
• rose
Creates a curve evaluator object for a rose, a special form of hypotrochoid.
• scaleTo
Creates a modified version of this curve so that it fits the given radius.

### Hypotrochoid#arcLength(u)

Finds an approximate arc length (distance) between the start of this curve and the point at the given U coordinate of this curve.

#### Parameters

• `u` (Type: number)
U coordinate of a point on the curve.

#### Return Value

The approximate arc length of this curve at the given U coordinate. (Type: Array.<number>)

### Hypotrochoid#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>)

### Hypotrochoid#evaluate(u)

Finds the coordinates of 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 can be other than 0. (Type: Array.<number>)

### (static) Hypotrochoid.rose(n, distFromInnerCenter, [rotationDegrees])

Creates a curve evaluator object for a rose, a special form of hypotrochoid.

#### Parameters

• `n` (Type: number)
Parameter that determines the petal form of the rose. For example, the rose is symmetrical if this number is even.
• `distFromInnerCenter` (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.

#### Return Value

The resulting curve evaluator object. (Type: Hypotrochoid)

• `radius` (Type: number)