Skip to main content

unit-tangent

function unitTangent(ps: number[][], t: number): number[] | undefined

Defined in local-properties-at-t/tangent/double/unit-tangent.ts:17

Returns the unit tangent vector of an order 0,1,2 or 3 bezier curve at a specific given parameter value t.

  • uses double precision calculations internally
  • returns undefined if the tangent vanishes at t (e.g. at a cusp) since the curve has no well-defined direction there

Parameters:

NameTypeDescription
psnumber[][]a linear, quadratic or cubic bezier, e.g. [[0,0],[1,1],[2,1],[2,0]]
tnumberthe t parameter