gl-matrix's mat2, split into smaller pieces
Last updated 3 years ago by substack .
zlib · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gl-mat2 
SYNC missed versions from official npm registry.

gl-mat2 stable

Part of a fork of @toji's gl-matrix split into smaller pieces: this package contains glMatrix.mat2.



mat2 = require('gl-mat2')

Will load all of the module's functionality and expose it on a single object. Note that any of the methods may also be required directly from their files.

For example, the following are equivalent:

var scale = require('gl-mat2').scale
var scale = require('gl-mat2/scale')


mat2.adjoint(out:mat2, a:mat2)

Calculates the adjugate of a mat2

mat2.copy(out:mat2, a:mat2)

Copy the values from one mat2 to another


Creates a new identity mat2


Calculates the determinant of a mat2


Returns Frobenius norm of a mat2


Set a mat2 to the identity matrix

mat2.invert(out:mat2, a:mat2)

Inverts a mat2

mat2.ldu(L:mat2, D:mat2, U:mat2, a:mat2)

Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix

mat2.multiply(out:mat2, a:mat2, b:mat2)

Multiplies two mat2's

mat2.rotate(out:mat2, a:mat2, rad:Number)

Rotates a mat2 by the given angle

mat2.scale(out:mat2, a:mat2, v:vec2)

Scales the mat2 by the dimensions in the given vec2

mat2.transpose(out:mat2, a:mat2)

Transpose the values of a mat2


zlib. See for details.

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           6 years ago
Today 67
This Week 129
This Month 67
Last Day 62
Last Week 398
Last Month 1,453
Dependencies (0)
Dev Dependencies (1)
  • dox git://

Copyright 2014 - 2016 © |