跳转到内容

createRotateMatrix

createRotateMatrix(angle, pivotPoint?): TMat2D

Generate a rotation matrix around around a point (x,y), defaulting to (0,0)

A matrix in the form of [cos(a) -sin(a) -xcos(a)+ysin(a)+x] [sin(a) cos(a) -xsin(a)-ycos(a)+y] [0 0 1 ]

Parameters

angle: TRotateMatrixArgs = {}

rotation in degrees

pivotPoint?: Partial<XY> = {}

pivot point to rotate around

Returns

TMat2D

matrix

Defined in

src/util/misc/matrix.ts:169