MCPcopy
hub / github.com/tldraw/tldraw / canonicalizeRotation

Function canonicalizeRotation

packages/editor/src/lib/primitives/utils.ts:108–117  ·  view source on GitHub ↗
(a: number)

Source from the content-addressed store, hash-verified

106 * @public
107 */
108export function canonicalizeRotation(a: number) {
109 a = a % PI2
110 if (a < 0) {
111 a = a + PI2
112 } else if (a === 0) {
113 // prevent negative zero
114 a = 0
115 }
116 return a
117}
118
119/**
120 * Get the clockwise angle distance between two angles.

Callers 6

getFrameHeadingSideFunction · 0.90
resizing.test.tsFile · 0.90
rotateXFunction · 0.90
clockwiseAngleDistFunction · 0.85
getContainerHeadingSideFunction · 0.85

Calls

no outgoing calls

Tested by 1

rotateXFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…