# matrix-utilities

> Tiny, high performance utilities for performing 2/3D matrix calculations. Full unit test coverage, compatible with Node/CommonJS, AMD, and browser globals.

Latest version **1.2.4** (published 2013-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install matrix-utilities
pnpm add matrix-utilities
yarn add matrix-utilities
bun add matrix-utilities
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2013-10-26 |
| First published | 2013-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Boris Cherny |
| Maintainers | bcherny |
| Keywords | matrix, flip, identity, css, css3, transform, translate, rotate, skew, perspective, scale |

## Links

- npm: https://www.npmjs.com/package/matrix-utilities
- Repository: https://github.com/eighttrackmind/matrix-utilities
- Issues: https://github.com/eighttrackmind/matrix-utilities/issues
- npm.io page: https://npm.io/package/matrix-utilities

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.2.4 (latest) — 2013-10-26
- 1.2.3 — 2013-10-24
- 1.2.2 — 2013-10-24
- 1.2.1 — 2013-10-18
- 1.1.1 — 2013-10-18
- 1.1.0 — 2013-10-15
- 1.0.0 — 2013-10-10

## README

# matrix-utilities

[![Build Status](https://travis-ci.org/eighttrackmind/matrix-utilities.png)](https://travis-ci.org/eighttrackmind/matrix-utilities.png)
[![browser support](https://ci.testling.com/eighttrackmind/matrix-utilities.png)](https://ci.testling.com/eighttrackmind/matrix-utilities)

Tiny (607b gzipped), high performance utilities for performing 2/3D matrix calculations. Full unit test coverage, compatible with Node/CommonJS, AMD, and browser globals.

## API

```coffee
util = require 'matrix-utilities'

util.Identity() # returns new 3D identity matrix
util.add matrix1, matrix2 # returns matrix1 + matrix2
util.multiply matrix1, matrix2 # returns matrix1×matrix2
util.flip matrix # flip a matrix along x=y
util.to2d matrix
util.to3d matrix
```

## examples

```coffee
util = require 'matrix-utilities'

# identity

matrix = util.Identity()
###
	#=>
	[
		[1, 0, 0, 0]
		[0, 1, 0, 0]
		[0, 0, 1, 0]
		[0, 0, 0, 1]
	]
###

# to2d

util.to2d matrix
###
	#=>
	[
		[1, 0, 0]
		[0, 1, 0]
	]
###

# flip

util.flip [
	[1, 2, 3]
	[4, 5, 6]
	[7, 8, 9]
]
###
	#=>
	[
		[1, 4, 7]
		[2, 5, 8]
		[3, 6, 9]
	]
###

# add

one = [
	[2, 4]
	[6, 8]
]

two = [
	[1, 3]
	[5, 7]
]

util.add one, two
###
	#=>
	[
		[3, 7]
		[11, 15]
	]
###

# multiply

one = [
	[1, 2, 3]
	[4, 5, 6]
	[7, 8, 9]
]

two = [
	[1, 2]
	[3, 4]
	[5, 6]
]

util.multiply one, two
###
	#=>
	[
		[22, 28]
		[49, 64]
		[76, 100]
	]
###
```

---
_Source: https://npm.io/package/matrix-utilities · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
