Skip to content
FutureBlitz

    Install

    Import std.math.matrix

    Mat3

    std.math.matrix

    struct

    Public Struct Mat3 Implements Equatable, Printable

    A 3 by 3 matrix: a rotation, a scale, or both, of 3D vectors.

    Examples

    
    Local stretch = Mat3.Scale(Vec3(2, 3, 4))
    Expect(Determinant(stretch) == 24.0)
    Expect(stretch * Vec3(1, 1, 1) == Vec3(2, 3, 4))
    Expect(IsClose(Inverse(stretch) * stretch, Mat3.Identity))

    std/math/matrix.fb, line 37

    • Public Field x: Vec3 field #

      Its first column.

    • Public Field y: Vec3 field #

      Its second column.

    • Public Field z: Vec3 field #

      Its third column.

    • Public Static Property Identity: Mat3 property #

      The matrix that changes nothing.

    • Public Static Method Scale(scale: Vec3): Mat3 static method #

      The matrix that scales each axis by the vector's component.

    • Public Static Method Rotation(rotation: Quat): Mat3 static method #

      The rotation's matrix.

    • Public Static Method RotationX(angle: Float): Mat3 static method #

      The rotation by the angle, in radians, about the X axis.

    • Public Static Method RotationY(angle: Float): Mat3 static method #

      The rotation by the angle, in radians, about the Y axis.

    • Public Static Method RotationZ(angle: Float): Mat3 static method #

      The rotation by the angle, in radians, about the Z axis.

    • Public Method ToMat4(): Mat4 method #

      The matrix as a Mat4 that moves nothing.

    • Public Method ToString(): String method #

      Its columns, as "((1, 0, 0), (0, 1, 0), (0, 0, 1))".

    • @PanicsAtCaller Operator [](column: Int, row: Int): Float operator #

      The element in a column and a row, each from 0 to 2. Any other panics.

    • Operator *(a: Mat3, b: Mat3): Mat3 operator #

      The transform by b, then by a.

    • Operator *(m: Mat3, v: Vec3): Vec3 operator #

      The vector transformed.

    • Operator *(m: Mat3, scale: Float): Mat3 operator #

      m times scale.

    • Operator *(scale: Float, m: Mat3): Mat3 operator #

      scale times m.

    • Operator /(m: Mat3, scale: Float): Mat3 operator #

      m divided by scale.

    • Operator +(a: Mat3, b: Mat3): Mat3 operator #

      a plus b.

    • Operator -(a: Mat3, b: Mat3): Mat3 operator #

      a minus b.

    Report an issue with this page or with FutureBlitz on GitHub.