nurbsCurve.tangentAt

The unit tangent at a knot parameter, or null where the derivative vanishes.

GeometricSince 0.4.0

Usage

TypeScript
curve.tangentAt(t: number): Vector3 | null

Parameters

  • tnumber

    Knot parameter, in the curve’s domain.

    Required

Returns

A vector of length 1 along derivativeAt(t); null where the derivative is zero (e.g. at an end whose first two control points coincide) or not finite.

Guarantees

  • a non-null result has length 1 and points along derivativeAt(t) (Vector3.angleRad ≈ 0)
  • The same result on every machine.

Example

TypeScript
const q = NurbsCurve.create([Point3.of(1, 0, 0), Point3.of(1, 1, 0), Point3.of(0, 1, 0)], 2, { weights: [1, Math.SQRT1_2, 1], knots: [0, 0, 0, 1, 1, 1] }).value
q.tangentAt(1) // → { x: -1, y: 0, z: 0 }

See also