Options
All
• Public
• Public/Protected
• All

# Class Mat3

## Constructors

### constructor

• newMat3(other: Mat3): Mat3
• newMat3(m00?: undefined | number, m01?: undefined | number, m02?: undefined | number, m03?: undefined | number, m04?: undefined | number, m05?: undefined | number, m06?: undefined | number, m07?: undefined | number, m08?: undefined | number): Mat3

## Properties

m00: number

m01: number

m02: number

m03: number

m04: number

m05: number

m06: number

m07: number

m08: number

### Static IDENTITY

IDENTITY: {} = Object.freeze(new Mat3())

## Methods

• 矩阵加法。将当前矩阵与指定矩阵的相加，结果返回给当前矩阵。

#### Parameters

• ##### mat: Mat3

the second operand

### determinant

• determinant(): number
• 计算当前矩阵的行列式。

当前矩阵的行列式。

### equals

• equals(other: Mat3, epsilon?: number): boolean
• 判断当前矩阵是否在误差范围内与指定矩阵相等。

#### Parameters

• ##### other: Mat3

Comparative matrix

• ##### Default value epsilon: number = EPSILON

The error allowed. It`s should be a non-negative number.

#### Returns boolean

Returns `true' when the elements of both matrices are equal; otherwise returns`false'.

### fromQuat

• fromQuat(q: Quat): this
• 重置当前矩阵的值，使其表示指定四元数表示的旋转变换。

#### Parameters

• ##### q: Quat

The quaternion.

this

### identity

• identity(): this

### invert

• invert(): this
• 计算当前矩阵的逆矩阵。注意，在矩阵不可逆时，会返回一个全为 0 的矩阵。

### multiply

• multiply(mat: Mat3): this
• 矩阵乘法。将当前矩阵左乘指定矩阵的结果赋值给当前矩阵。

#### Parameters

• ##### mat: Mat3

the second operand

### multiplyScalar

• multiplyScalar(scalar: number): this
• 矩阵数乘。将当前矩阵与指定标量的数乘结果赋值给当前矩阵。

#### Parameters

• ##### scalar: number

amount to scale the matrix's elements by

### rotate

• 将当前矩阵左乘旋转矩阵的结果赋值给当前矩阵，旋转矩阵由旋转轴和旋转角度给出。

### scale

• scale(vec: Vec3): this
• 将当前矩阵左乘缩放矩阵的结果赋值给当前矩阵，缩放矩阵由各个轴的缩放给出。

#### Parameters

• ##### vec: Vec3

vector to scale by

### set

• set(other: Mat3): any
• set(m00?: undefined | number, m01?: undefined | number, m02?: undefined | number, m03?: undefined | number, m04?: undefined | number, m05?: undefined | number, m06?: undefined | number, m07?: undefined | number, m08?: undefined | number): any
• 设置当前矩阵使其与指定矩阵相等。

#### Parameters

• ##### other: Mat3

Specified matrix

this

• 设置当前矩阵指定元素值。

this

### strictEquals

• strictEquals(other: Mat3): boolean
• 判断当前矩阵是否与指定矩阵相等。

#### Parameters

• ##### other: Mat3

Comparative matrix

#### Returns boolean

Returns `true' when the elements of both matrices are equal; otherwise returns`false'.

### subtract

• subtract(mat: Mat3): this
• 计算矩阵减法。将当前矩阵减去指定矩阵的结果赋值给当前矩阵。

#### Parameters

• ##### mat: Mat3

the second operand

### toString

• toString(): string

### transpose

• transpose(): this

• add<Out>(out: Out, a: Out, b: Out): Out
• 逐元素矩阵加法

### Static clone

• clone<Out>(a: Out): Mat3
• 获得指定矩阵的拷贝

### Static copy

• copy<Out>(out: Out, a: Out): Out
• 复制目标矩阵

### Static determinant

• determinant<Out>(a: Out): number
• 矩阵行列式

### Static equals

• equals<Out>(a: Out, b: Out, epsilon?: number): boolean
• 排除浮点数误差的矩阵近似等价判断

### Static fromArray

• fromArray<Out>(out: Out, arr: IWritableArrayLike<number>, ofs?: number): Out
• 数组转矩阵

#### Parameters

• ##### Default value ofs: number = 0

Array Start Offset

• 取四阶矩阵的前三阶

### Static fromQuat

• 根据四元数旋转信息计算矩阵

### Static fromRotation

• fromRotation<Out>(out: Out, rad: number): Out
• 计算旋转矩阵

### Static fromScaling

• fromScaling<Out, VecLike>(out: Out, v: VecLike): Out
• 计算缩放矩阵

### Static fromTranslation

• fromTranslation<Out, VecLike>(out: Out, v: VecLike): Out
• 计算位移矩阵

### Static fromViewUp

• fromViewUp<Out, VecLike>(out: Out, view: VecLike, up?: Vec3): Out
• 根据视口前方向和上方向计算矩阵

#### Parameters

• ##### view: VecLike

The view direction, it`s must be normalized.

• ##### Optional up: Vec3

The view up direction, it`s must be normalized, default value is (0, 1, 0).

### Static identity

• identity<Out>(out: Out): Out
• 将目标赋值为单位矩阵

### Static inverseTransposeMat4

• inverseTransposeMat4<Out>(out: Out, a: IMat4Like): null | Out
• 计算指定四维矩阵的逆转置三维矩阵

### Static invert

• invert<Out>(out: Out, a: Out): Out
• 矩阵求逆，注意，在矩阵不可逆时，会返回一个全为 0 的矩阵。

### Static multiply

• multiply<Out>(out: Out, a: Out, b: Out): Out
• 矩阵乘法

### Static multiplyMat4

• multiplyMat4<Out>(out: Out, a: Out, b: IMat4Like): Out
• 取四阶矩阵的前三阶，与三阶矩阵相乘

### Static multiplyScalar

• multiplyScalar<Out>(out: Out, a: Out, b: number): Out
• 矩阵标量乘法

#### Returns Out

• multiplyScalarAndAdd<Out>(out: Out, a: Out, b: Out, scale: number): Out
• 逐元素矩阵标量乘加: A + B * scale

### Static rotate

• rotate<Out>(out: Out, a: Out, rad: number): Out
• 在给定矩阵变换基础上加入新旋转变换

### Static scale

• scale<Out, VecLike>(out: Out, a: Out, v: VecLike): Out
• 在给定矩阵变换基础上加入新缩放变换

### Static set

• set<Out>(out: Out, m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): Out
• 设置矩阵值

### Static strictEquals

• strictEquals<Out>(a: Out, b: Out): boolean
• 矩阵等价判断

### Static subtract

• subtract<Out>(out: Out, a: Out, b: Out): Out
• 逐元素矩阵减法

### Static toArray

• toArray<Out>(out: Out, m: IMat3Like, ofs?: number): Out
• 矩阵转数组

#### Parameters

• ##### Default value ofs: number = 0

Array Start Offset

### Static transform

• transform<Out, VecLike>(out: Out, a: Out, v: VecLike): Out
• 在给定矩阵变换基础上加入变换

### Static transpose

• transpose<Out>(out: Out, a: Out): Out
• 转置矩阵

#### Returns Out

Generated using TypeDoc