Home
API: forms

Function: rotateTurns()

lifecycle-kit

lifecycle-kit


lifecycle-kit / forms / rotateTurns

Function: rotateTurns()

rotateTurns(path, turns): Path

Defined in: forms/rules/transform.ts:139

Rotate every coordinate about the origin by an angle in TURNS (see path.ts's header on why phase and angle are turns rather than radians — the same exactness argument applies here: a rule that places copies at i / count turns wants turn 1 to equal turn 0 exactly).

An ellipse rotates about its own centre losslessly only when its centre is the origin being rotated about, which is the only case this package's rules ever need (a unit shape authored at the origin, rotated into place) — see the note on mapPoints.

Parameters

path

Path

turns

number

Returns

Path