Class: DefCurveNormal

algeobra~DefCurveNormal(topt, normalizeopt, scaleopt)

Definition for a normal on a curve Will calculate the normal given a parameter Supported curve objects are: Line, vector (treated as a line from reference to arrow tip), arc, line strip, Bezier, Bezier spline, ellipse

Constructor

new DefCurveNormal(topt, normalizeopt, scaleopt)

Default values
Parameters:
Name Type Attributes Description
t Number <optional>
The t value
normalize Boolean <optional>
Whether the resulting vector should be normalized
scale Number <optional>
Scaling of the resulting vector
Source:

Methods

compute(createInfo) → {Object}

Computes the curve normal
Parameters:
Name Type Description
createInfo CreateInfo The creation info
Source:
Returns:
An object of type TYPE_VECTOR
Type
Object

(static) bezierNormal(points, t) → {Object}

Computes the normal on a Bezier curve.
Parameters:
Name Type Description
points Object The control points
t Number The curve parameter
Source:
Returns:
The resulting normal
Type
Object

(static) bezierSplineNormal(points, degree, t) → {Object}

Computes the normal on a Bezier spline.
Parameters:
Name Type Description
points Object The control points
degree Number The spline degree
t Number The curve parameter
Source:
Returns:
The resulting normal
Type
Object

(static) circleNormal(r, alpha) → {Object}

Computes the normal on a circle.
Parameters:
Name Type Description
r Number The circle radius
alpha Number The angle
Source:
Returns:
The resulting normal
Type
Object

(static) ellipseNormal(rx, ry, rotation, alpha) → {Object}

Computes the normal on a ellipse.
Parameters:
Name Type Description
rx Number The ellipse x-eccentricity
ry Number The ellipse y-eccentricity
rotation Number The ellipse rotation
alpha Number The angle
Source:
Returns:
The resulting normal
Type
Object

(static) fromCurve(obj, topt, normalizeopt, scaleopt) → {CreateInfo}

Computes the normal on a curve
Parameters:
Name Type Attributes Description
obj Number | Object Either the index or value of a curve object. The supported types are specified at the documention of this class
t Number | Object <optional>
Either the index or value of a TYPE_NUMBER. The curve parameter
normalize Number | Object <optional>
Either the index or value of a TYPE_BOOLEAN. Whether result will be normalized
scale Number | Object <optional>
Either the index or value of a TYPE_NUMBER. Scaling of result
Source:
Returns:
The creation info
Type
CreateInfo

(static) lineNormal(p0, p1) → {Object}

Computes the normal on a line.
Parameters:
Name Type Description
p0 Object The first line point
p1 Object The second line point
Source:
Returns:
The resulting normal
Type
Object

(static) lineStripNormal(points, t) → {Object}

Computes the normal on a line strip.
Parameters:
Name Type Description
points Object The line strip points
t Number The curve parameter
Source:
Returns:
The resulting normal
Type
Object

(static) normalRefFromObject(obj, t) → {Object}

Computes the normal and corresponding reference point on a curve. Supported types are documented at the top of this class
Parameters:
Name Type Description
obj Object The curve object
t Number The curve parameter
Source:
Returns:
The resulting normal and reference point
Type
Object

(static) polygonNormal(points, t) → {Object}

Computes the normal on a polygon.
Parameters:
Name Type Description
points Object The polygon points
t Number The curve parameter
Source:
Returns:
The resulting normal
Type
Object