nurbsCurve.tangentAt
The unit tangent at a knot parameter, or null where the derivative vanishes.
Usage
curve.tangentAt(t: number): Vector3 | nullParameters
tnumberKnot parameter, in the curve’s domain.
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
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 }