Skip to content

datatypesjs/matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Matrix

Class for 4 by 4 row-major matrices for transformations in 3D.

Installation

npm install --save @datatypes/matrix

Usage

import Matrix from '@datatypes/matrix'

const matrixA = Matrix.fromRows([
	[1, 2, 3],
	[4, 5, 6],
	[7, 8, 9]
])
const matrixB = Matrix.fromRows([
	[ 7,  8],
	[ 9, 10],
	[11, 12]
])

console.log(
	matrixA
		.multiply(matrixB)
		.toRows()
)

Output:

[
	[ 58,  64],
	[139, 154],
	[220, 244]
]

For a more detailed listing of available features check out the tests.

About

Class for 4x4 row-major matrices for transformations in 3D

Resources

Stars

Watchers

Forks

Packages

No packages published