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
- Host: GitHub
- URL: https://github.com/dawee/transform-matrix
- Owner: dawee
- Created: 2016-06-03T10:42:43.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-20T11:17:39.000Z (about 10 years ago)
- Last Synced: 2024-04-24T19:04:04.364Z (about 2 years ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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)
```