Class: DefCurveTangent

algeobra~DefCurveTangent(topt, normalizeopt, scaleopt)

Definition for a tangent on a curve Will calculate the tangent 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 DefCurveTangent(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 tangent
Parameters:
Name Type Description
createInfo CreateInfo The creation info
Source:
Returns:
An object of type TYPE_VECTOR
Type
Object

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

Computes the tangent 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 tangent
Type
Object

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

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

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

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

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

Computes the tangent 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 tangent and reference point
Type
Object

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

Computes the tangent 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 tangent
Type
Object

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

Computes the tangent 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) lineStripTangent(points, t) → {Object}

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

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

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

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

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

(static) vectorTangent(v) → {Object}

Computes the point on a vector. The vector is treated as a line segment from the reference to the arrow tip
Parameters:
Name Type Description
v Object The vector
Source:
Returns:
The resulting tangent
Type
Object