Socket
Socket
Sign inDemoInstall

transformation-matrix

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transformation-matrix

2d transformation matrix functions written in ES6 syntax. Tree shaking ready!


Version published
Weekly downloads
157K
decreased by-7.86%
Maintainers
1
Weekly downloads
 
Created

What is transformation-matrix?

The 'transformation-matrix' npm package provides a set of utilities for working with 2D affine transformations. It allows you to create, manipulate, and apply transformation matrices for operations such as translation, rotation, scaling, and skewing.

What are transformation-matrix's main functionalities?

Translation

This feature allows you to create a translation matrix that moves points by a specified distance along the x and y axes.

const { translate } = require('transformation-matrix');
const translationMatrix = translate(10, 20);
console.log(translationMatrix);

Rotation

This feature allows you to create a rotation matrix that rotates points by a specified angle in radians.

const { rotate } = require('transformation-matrix');
const rotationMatrix = rotate(Math.PI / 4);
console.log(rotationMatrix);

Scaling

This feature allows you to create a scaling matrix that scales points by specified factors along the x and y axes.

const { scale } = require('transformation-matrix');
const scalingMatrix = scale(2, 3);
console.log(scalingMatrix);

Skewing

This feature allows you to create a skewing matrix that skews points by specified angles along the x and y axes.

const { skew } = require('transformation-matrix');
const skewingMatrix = skew(0.5, 0.3);
console.log(skewingMatrix);

Combining Transformations

This feature allows you to combine multiple transformation matrices into a single matrix.

const { compose, translate, rotate, scale } = require('transformation-matrix');
const combinedMatrix = compose(translate(10, 20), rotate(Math.PI / 4), scale(2, 3));
console.log(combinedMatrix);

Other packages similar to transformation-matrix

Keywords

FAQs

Package last updated on 23 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc