Function

cardinal

(pt1: Vec2, m1: Vec2, m2: Vec2, pt2: Vec2, tension: number): (t: number) => Vec2

A second order function returning an evaluator for the given 2D Cardinal curve

param pt1 - Previous point

param m1 - First point

param m2 - Second point

param pt2 - Next point

param tension The tension of the curve, [0..1] from round to tight.

returns A function which gives the value on the 2D Cardinal curve at t

kaplay logo

Layer

Miscellaneous