Hypotrochoid
### Hypotrochoid(outerRadius, innerRadius, distFromInnerCenter, [rotationDegrees])
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
).<ul>
</ul>
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)
Radius of the rolling circle. A hypocycloid results when distFromInnerCenter=innerRadius.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.
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>)
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>)
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)
### Hypotrochoid#scaleTo(radius)
Creates a modified version of this curve so that it fits the given radius.
Parameters
radius
(Type: number)
Desired radius of the curve.
Return Value
Return value. (Type: Hypotrochoid)