0.1.3 • Published 8 years ago

mecks v0.1.3

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

mecks

Build Status

Minimum Linear Algebra Library

Usage

npm install mecks

mecks was built immutable on purpose and relies on the vecks vector library.

Contributing

While developing make sure you use gulp watch to ease the process of testing your contribution.

Documentation


Matrix2

Members:

  • nullMatrixData
  • identityMatrixData

Matrix2.Matrix2()

A 2x2 matrix

Matrix2.construct()

Construct the matrix using a linearized array

Matrix2.at(i, j)

Access an element of the matrix.

Parameters

i: number, row index

j: number, column index

Matrix2.data()

Get all elements of the matrix.

Returns: Array.<number>, linearized data of the matrix

Matrix2.det()

Calculate the determinant of the matrix.

Returns: float

Matrix2.inv()

Invert the Matrix.

Returns: Matrix2

Matrix2.mulV(v)

Multiply a given vector with this matrix.

Parameters

v: , Multiply a given vector with this matrix.

Returns: Vec2

Matrix2.add(rhs)

Add a given righthandside Matrix2 to this Matrix.

Parameters

rhs: , Add a given righthandside Matrix2 to this Matrix.

Returns: Matrix2

Matrix2.sub(rhs)

Subtract a given righthandside Matrix2 to this Matrix.

Parameters

rhs: , Subtract a given righthandside Matrix2 to this Matrix.

Returns: Matrix2

Matrix2.mul(rhs)

Multiply the Matrix by a given righthandside Matrix2.

Parameters

rhs: , Multiply the Matrix by a given righthandside Matrix2.

Returns: Matrix2

Matrix2.addS(s)

Add a Scalar value to the Matrix.

Parameters

s: , Add a Scalar value to the Matrix.

Returns: Matrix2

Matrix2.subS(s)

Subtract a Scalar value from the Matrix.

Parameters

s: , Subtract a Scalar value from the Matrix.

Returns: Matrix2

Matrix2.mulS(s)

Multiply the Matrix by a Scalar Value.

Parameters

s: , Multiply the Matrix by a Scalar Value.

Returns: Matrix2

Matrix2.divS(s)

Divide the Matrix by a Scalar Value.

Parameters

s: , Divide the Matrix by a Scalar Value.

Returns: Matrix2

Matrix2.identity()

Returns a new Identity Matrix.

Returns: Matrix2

Matrix2.nullMatrix()

Returns a new Null Matrix.

Returns: Matrix2


Matrix3

Members:

  • nullMatrixData
  • identityMatrixData

Matrix3.Matrix3()

A 3x3 matrix

Matrix3.construct()

Construct the matrix using a linearized array

Matrix3.at(i, j)

Access an element of the matrix.

Parameters

i: number, row index

j: number, column index

Matrix3.data()

Get all elements of the matrix.

Returns: Array.<number>, linearized data of the matrix

Matrix3.det()

Calculate the determinant of the matrix.

Returns: float

Matrix3.inv()

Invert the Matrix.

Returns: Matrix3

Matrix3.add(rhs)

Add a given righthandside Matrix4 to this Matrix.

Parameters

rhs: , Add a given righthandside Matrix4 to this Matrix.

Returns: Matrix3

Matrix3.sub(rhs)

Subtract a given righthandside Matrix4 to this Matrix.

Parameters

rhs: , Subtract a given righthandside Matrix4 to this Matrix.

Returns: Matrix3

Matrix3.mul(rhs)

Multiply the Matrix by a given righthandside Matrix.

Parameters

rhs: , Multiply the Matrix by a given righthandside Matrix.

Returns: Matrix3

Matrix3.mulV(rhs)

Multiply a given vector

Parameters

rhs: , Multiply a given vector

Returns: Vec3

Matrix3.addS(s)

Add a Scalar value to the Matrix.

Parameters

s: , Add a Scalar value to the Matrix.

Returns: Matrix4

Matrix3.subS(s)

Subtract a Scalar value from the Matrix.

Parameters

s: , Subtract a Scalar value from the Matrix.

Returns: Matrix4

Matrix3.mulS(s)

Multiply the Matrix by a Scalar Value.

Parameters

s: , Multiply the Matrix by a Scalar Value.

Returns: Matrix4

Matrix3.divS(s)

Divide the Matrix by a Scalar Value.

Parameters

s: , Divide the Matrix by a Scalar Value.

Returns: Matrix4

Matrix3.identity()

Returns a new Identity Matrix.

Returns: Matrix3

Matrix3.nullMatrix()

Returns a new Null Matrix.

Returns: Matrix3


Matrix4

Members:

  • nullMatrixData
  • identityMatrixData

Matrix4.Matrix4()

A 4x4 matrix

Matrix4.at(i, j)

Access an element of the matrix.

Parameters

i: number, row index

j: number, column index

Matrix4.data()

Get all elements of the matrix.

Returns: Array.<number>, linearized data of the matrix

Matrix4.det()

Calculate the determinant of the matrix.

Returns: float

Matrix4.inv()

Invert the Matrix.

Returns: Matrix2

Matrix4.mulV(rhs)

Multiply a given vector with this matrix.

Parameters

rhs: , Multiply a given vector with this matrix.

Returns: Vec3

Matrix4.add(rhs)

Add a given righthandside Matrix4 to this Matrix.

Parameters

rhs: , Add a given righthandside Matrix4 to this Matrix.

Returns: Matrix4

Matrix4.sub(rhs)

Subtract a given righthandside Matrix4 to this Matrix.

Parameters

rhs: , Subtract a given righthandside Matrix4 to this Matrix.

Returns: Matrix4

Matrix4.mul(rhs)

Multiply the Matrix by a given righthandside Matrix4.

Parameters

rhs: , Multiply the Matrix by a given righthandside Matrix4.

Returns: Matrix4

Matrix4.addS(s)

Add a Scalar value to the Matrix.

Parameters

s: , Add a Scalar value to the Matrix.

Returns: Matrix4

Matrix4.subS(s)

Subtract a Scalar value from the Matrix.

Parameters

s: , Subtract a Scalar value from the Matrix.

Returns: Matrix4

Matrix4.mulS(s)

Multiply the Matrix by a Scalar Value.

Parameters

s: , Multiply the Matrix by a Scalar Value.

Returns: Matrix4

Matrix4.divS(s)

Divide the Matrix by a Scalar Value.

Parameters

s: , Divide the Matrix by a Scalar Value.

Returns: Matrix4

Matrix4.identity()

Returns a new Identity Matrix.

Returns: Matrix4

Matrix4.nullMatrix()

Returns a new Null Matrix.

Returns: Matrix4


Plane


Plane.Plane()

A Plane representation

Plane.project()

Project a point onto the plane.


0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago