Coopa

Geometry API

Based on DOM Geometry Interfaces Module Level 1

Only provide polyfill for platform without DOMMatrix, DOMPoint, DOMRect.

But use the browser native implementation if possible.

Still In development

DOMMatrix

https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix

let mat: DOMMatrix = createMatrix()
mat.translateSelf(x, y, z)
mat.rotateSelf(x, y, z)

and add few helpers:

DOMPoint

https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint

let point: DOMPoint = createPoint(x, y)
point.matrixTransform(mat)

DOMRect

https://developer.mozilla.org/en-US/docs/Web/API/DOMRect

let rect: DOMRect = createRect(x, y, width, height)
rect.top
rect.left
rect.right
rect.bottom