Package Exports
- @thi.ng/matrices
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@thi.ng/matrices) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@thi.ng/matrices
This project is part of the @thi.ng/umbrella monorepo.
About
This package provides 160+ matrix & quaternion operations for 2D/3D geometry processing and acts as companion package for @thi.ng/vectors. Like with the vectors package, most functions are defined as multi-method dispatching to optimized implementations based on matrix size (which themselves are exposed for direct use too).
Any ArrayLike type can be used as matrix containers (e.g. JS arrays,
typed arrays, custom impls) and hence many other functions provided by
the vectors package can also be used directly with matrices (where
sensible).
Related packages
- @thi.ng/color - vector based color operations / conversions
- @thi.ng/geom - 2D/3D geometry types & operations
- @thi.ng/vectors - optimized 2d/3d/4d and arbitrary length vector ops
- @thi.ng/vector-pools - operations on memory mapped data
Installation
yarn add @thi.ng/matricesDependencies
Usage examples
import * as m from "@thi.ng/matrices";API
Constants
IDENT22/IDENT23/IDENT33/IDENT44
Matrix creation
rotation22/rotation23rotationAroundAxis33/rotationAroundAxis44rotationX33/rotationX44rotationY33/rotationY44rotationZ33/rotationZ44scale22/scale23/scale33/scale44scaleWithCenter23/scaleWithCenter44shearX22/shearY22shearX23/shearY23shearXY33/shearXZ33/shearYX33/shearYZ33/shearZX33/shearZY33shearXY44/shearXZ44/shearYX44/shearYZ44/shearZX44/shearZY44skewX22/skewY22skewX23/skewY23skewXY33/skewXZ33/skewYX33/skewYZ33/skewZX33/skewZY33skewXY44/skewXZ44/skewYX44/skewYZ44/skewZX44/skewZY44translation23/translation44
WebGL related
frustum/frustumBoundslookAtorthoperspectiveviewport
Matrix conversion
mat33to44/mat44to33normal44
Setters
set/set22/set23/set33/set44identity/identity22/identity23/identity33/identity44
Row & column accessors
column/column22/column23/column33/column44row/row22/row23/row33/row44
Componentwise matrix - matrix
add/add22/add23/add33/add44div/div22/div23/div33/div44mul/mul22/mul23/mul33/mul44sub/sub22/sub23/sub33/sub44
Componentwise matrix - scalar
addN/addN22/addN23/addN33/addN44divN/divN22/divN23/divN33/divN44mulN/mulN22/mulN23/mulN33/mulN44subN/subN22/subN23/subN33/subN44
Matrix multiplication
mulM/mulM22/mulM23/mulM33/mulM44concat
Matrix - vector multiplication
mulV/mulV22/mulV23/mulV33/mulV344/mulV44projectunproject
Determinant & inversion
det22/det23/det33/det44det44FromCoeffs/detCoeffs44diag/diag22/diag23/diag33/diag44invert/invert22/invert23/invert33/invert44trace
Matrix transposition
transpose22/transpose33/transpose44
Quaternion
alignmentQuatconjugateQinvertQmixQmulQmulVQquatFromAxisAnglequatFromEulerquatToAxisAnglequatToMat33quatToMat44
Authors
- Karsten Schmidt
License
© 2018 Karsten Schmidt // Apache Software License 2.0