An open API service indexing awesome lists of open source software.

https://github.com/dawee/transform-matrix

ES6 Matrix for transform attribute manipulation
https://github.com/dawee/transform-matrix

Last synced: 3 months ago
JSON representation

ES6 Matrix for transform attribute manipulation

Awesome Lists containing this project

README

          

# TransformMatrix

ES6 Matrix for transform attribute manipulation

## Install

```js
npm install transform-matrix
```

## Usage

As it's an implementation of the [2D Affine Transformation Matrix](https://github.com/epistemex/transformation-matrix-js). Most of usage [can be read here](https://github.com/epistemex/transformation-matrix-js/blob/master/readme.md).

### deserialize / serialize

```js
import Matrix from 'transform-matrix';

let matrix = Matrix.deserialize('matrix(1,0,0,1,0,0)');

matrix = matrix.translate(88, 99);

console.log(matrix.serialize()); // matrix(1,0,0,1,88,99)
```