Home Reference Source
import {SymmetricMatrix3} from 'rabbit-hole'
public class | source

SymmetricMatrix3

A symmetric 3x3 matrix.

Static Method Summary

Static Public Methods
public static

Calculates the linear index of an element from this matrix.

Constructor Summary

Public Constructor
public

Constructs a new symmetric matrix.

Member Summary

Public Members
public

The matrix elements.

Method Summary

Public Methods
public

Adds the values of a given symmetric matrix to this one.

public

applyToVector3(v: Vector3): Vector3

Applies this symmetric matrix to a vector.

public

Clones this matrix.

public

Copies the values of a given symmetric matrix.

public

Checks if this matrix equals the given one.

public

Sets this matrix to the identity matrix.

public

Calculates the Frobenius norm of this matrix.

public

off(): Number

Calculates the absolute sum of all matrix components except for the main diagonal.

public

set(m00: Number, m01: Number, m02: Number, m11: Number, m12: Number, m22: Number): SymmetricMatrix3

Sets the values of this matrix.

public

toMatrix3(m: Matrix3)

Copies this symmetric matrix into a given 3x3 matrix.

Static Public Methods

public static calculateIndex(i: Number, j: Number): Number source

Calculates the linear index of an element from this matrix.

Let N be the dimension of the symmetric matrix:

index = N * (N - 1) / 2 - (N - i) * (N - i - 1) / 2 + j

Params:

NameTypeAttributeDescription
i Number

The row.

j Number

The column.

Return:

Number

The index into the elements of this matrix.

Public Constructors

public constructor() source

Constructs a new symmetric matrix.

Public Members

public elements: Float32Array source

The matrix elements.

Public Methods

public add(m: SymmetricMatrix3): SymmetricMatrix3 source

Adds the values of a given symmetric matrix to this one.

Params:

NameTypeAttributeDescription
m SymmetricMatrix3

A matrix.

Return:

SymmetricMatrix3

This matrix.

public applyToVector3(v: Vector3): Vector3 source

Applies this symmetric matrix to a vector.

Params:

NameTypeAttributeDescription
v Vector3

The vector to modify.

Return:

Vector3

The modified vector.

public clone(): SymmetricMatrix3 source

Clones this matrix.

Return:

SymmetricMatrix3

A clone of this matrix.

public copy(m: SymmetricMatrix3): SymmetricMatrix3 source

Copies the values of a given symmetric matrix.

Params:

NameTypeAttributeDescription
m SymmetricMatrix3

A matrix.

Return:

SymmetricMatrix3

This matrix.

public equals(m: SymmetricMatrix3): Boolean source

Checks if this matrix equals the given one.

Params:

NameTypeAttributeDescription
m SymmetricMatrix3

A matrix.

Return:

Boolean

Whether the matrices are equal.

public identity(): SymmetricMatrix3 source

Sets this matrix to the identity matrix.

Return:

SymmetricMatrix3

This matrix.

public norm(): Number source

Calculates the Frobenius norm of this matrix.

Return:

Number

The norm of this matrix.

public off(): Number source

Calculates the absolute sum of all matrix components except for the main diagonal.

Return:

Number

The offset of this matrix.

public set(m00: Number, m01: Number, m02: Number, m11: Number, m12: Number, m22: Number): SymmetricMatrix3 source

Sets the values of this matrix.

Params:

NameTypeAttributeDescription
m00 Number

The value of the first row, first column.

m01 Number

The value of the first row, second column and the second row, first column.

m02 Number

The value of the first row, third column and the third row, first column.

m11 Number

The value of the second row, second column.

m12 Number

The value of the second row, third column and third row, second column.

m22 Number

The value of the third row, third column.

Return:

SymmetricMatrix3

This matrix.

public toMatrix3(m: Matrix3) source

Copies this symmetric matrix into a given 3x3 matrix.

Params:

NameTypeAttributeDescription
m Matrix3

The target matrix.