Math v0.0.1
float3x3

Floating point 3x3 matrix structure. More...

#include <float.hpp>

Public Member Functions

constexpr float3x3 (float n=0.0f) noexcept
 Creates a new floating point 3x3 matrix structure.
 
constexpr float3x3 (float c0r0, float c1r0, float c2r0, float c0r1, float c1r1, float c2r1, float c0r2, float c1r2, float c2r2) noexcept
 Creates a new floating point 3x3 matrix structure.
 
constexpr float3x3 (float3 c0, float3 c1, float3 c2) noexcept
 Creates a new floating point 3x3 matrix structure.
 
constexpr operator float2x2 () const noexcept
 Returns matrix 2x2 part.
 
float3operator[] (psize i) noexcept
 Returns matrix column by index.
 
float3 operator[] (psize i) const noexcept
 Returns matrix column by index.
 
constexpr float3x3 operator+ (float n) const noexcept
 
constexpr float3x3 operator- (float n) const noexcept
 
constexpr float3x3 operator* (float n) const noexcept
 
constexpr float3x3 operator/ (float n) const noexcept
 
float3x3operator+= (float n) noexcept
 
float3x3operator-= (float n) noexcept
 
float3x3operator*= (float n) noexcept
 
float3x3operator/= (float n) noexcept
 
constexpr float3x3 operator* (const float3x3 &m) const noexcept
 Calculates dot product between two matrices.
 
constexpr float3 operator* (float3 v) const noexcept
 Calculates dot product between matrix and vector.
 
float3x3operator*= (const float3x3 &m) noexcept
 Calculates dot product between two matrices.
 
bool operator== (const float3x3 &m) const noexcept
 Returns true if matrices have the same values.
 
bool operator!= (const float3x3 &m) const noexcept
 Returns true if matrices have different values.
 

Public Attributes

float3 c0
 
float3 c1
 
float3 c2
 

Static Public Attributes

static const float3x3 zero = float3x3(0.0f)
 
static const float3x3 one = float3x3(1.0f)
 
static const float3x3 minusOne = float3x3(-1.0f)
 
static const float3x3 identity
 

Detailed Description

Floating point 3x3 matrix structure.

Commonly used for basic transformations: translation, scale, rotation, etc.

Constructor & Destructor Documentation

◆ float3x3() [1/3]

constexpr float3x3 ( float n = 0.0f)
inlineexplicitconstexprnoexcept

Creates a new floating point 3x3 matrix structure.

Parameters
ntarget value for all columns and rows

◆ float3x3() [2/3]

constexpr float3x3 ( float c0r0,
float c1r0,
float c2r0,
float c0r1,
float c1r1,
float c2r1,
float c0r2,
float c1r2,
float c2r2 )
inlineconstexprnoexcept

Creates a new floating point 3x3 matrix structure.

See the float3x3.

◆ float3x3() [3/3]

constexpr float3x3 ( float3 c0,
float3 c1,
float3 c2 )
inlineconstexprnoexcept

Creates a new floating point 3x3 matrix structure.

Parameters
c0first matrix column value
c1second matrix column value
c2third matrix column value

Member Function Documentation

◆ operator[]() [1/2]

float3 & operator[] ( psize i)
inlinenoexcept

Returns matrix column by index.

Parameters
itarget column index

◆ operator[]() [2/2]

float3 operator[] ( psize i) const
inlinenoexcept

Returns matrix column by index.

Parameters
itarget column index

◆ operator*() [1/2]

constexpr float3x3 operator* ( const float3x3 & m) const
inlineconstexprnoexcept

Calculates dot product between two matrices.

Parameters
[in]mtarget matrix to dot by

◆ operator*() [2/2]

constexpr float3 operator* ( float3 v) const
inlineconstexprnoexcept

Calculates dot product between matrix and vector.

Parameters
vtarget vector to dot by

◆ operator*=()

float3x3 & operator*= ( const float3x3 & m)
inlinenoexcept

Calculates dot product between two matrices.

Parameters
[in]mtarget matrix to dot by

◆ operator==()

bool operator== ( const float3x3 & m) const
inlinenoexcept

Returns true if matrices have the same values.

Parameters
[in]manother matrix to compare with

◆ operator!=()

bool operator!= ( const float3x3 & m) const
inlinenoexcept

Returns true if matrices have different values.

Parameters
[in]manother matrix to compare with

Member Data Documentation

◆ c0

float3 c0

First matrix column.

◆ c1

float3 c1

Second matrix column.

◆ c2

float3 c2

Third matrix column.

◆ identity

const float3x3 identity
inlinestatic
Initial value:
1.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 1.0f)
constexpr float3x3(float n=0.0f) noexcept
Creates a new floating point 3x3 matrix structure.
Definition float.hpp:152