reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

ofMatrix3x3.h
Go to the documentation of this file.
1/*
2 * Credits:
3 * Code adopted from Lode Vandevenne http://student.kuleuven.be/~m0216922/CG/
4 */
5
6#pragma once
7
8#include "ofConstants.h"
9#include <glm/mat3x3.hpp>
10
11
19
21
22
23public:
24
25 float a;
26 float b;
27 float c;
28 float d;
29 float e;
30 float f;
31 float g;
32 float h;
33 float i;
34
35
36
37 //---------------------
40
41 ofMatrix3x3( float _a=0.0, float _b=0.0, float _c=0.0,
42 float _d=0.0, float _e=0.0, float _f=0.0,
43 float _g=0.0, float _h=0.0, float _i=0.0 );
44
45
46 ofMatrix3x3( const glm::mat3 & mat) {
47 *this = reinterpret_cast<const ofMatrix3x3&>(mat);
48 }
49
50 operator glm::mat3() const{
51 return *reinterpret_cast<const glm::mat3*>(this);
52 }
53
55
56 //---------------------
59
60 void set( float _a, float _b, float _c,
61 float _d, float _e, float _f,
62 float _g, float _h, float _i );
63
64
65 float& operator[]( const int& index );
66
67
69
70 //---------------------
73
74
82 void transpose();
83
88
91 float determinant() const;
92
93 float determinant(const ofMatrix3x3& A);
94
95
96
97
108
109 void invert();
110
111
116
118
119 //---------------------
122
123
124
127
129 void operator+=(const ofMatrix3x3& B);
130
133
135 void operator-=(const ofMatrix3x3& B);
136
138 ofMatrix3x3 operator*(float scalar);
139
141 void operator*=(const ofMatrix3x3& B);
142
144 void operator*=(float scalar);
145
148
150 ofMatrix3x3 operator/(float scalar);
151
152 void operator/=(const ofMatrix3x3& B);
153
154 void operator/=(float scalar);
155
156 friend std::ostream& operator<<(std::ostream& os, const ofMatrix3x3& M);
157 friend std::istream& operator>>(std::istream& is, ofMatrix3x3& M);
158
160};
161
A 3x3 Matrix.
Definition ofMatrix3x3.h:20
ofMatrix3x3 operator*(float scalar)
Multiply a matrix with a scalar
Definition ofMatrix3x3.cpp:199
float e
Definition ofMatrix3x3.h:29
float h
Definition ofMatrix3x3.h:32
float f
Definition ofMatrix3x3.h:30
ofMatrix3x3 inverse(const ofMatrix3x3 &A)
Inverse of a 3x3 matrix.
Definition ofMatrix3x3.cpp:129
ofMatrix3x3(const glm::mat3 &mat)
Definition ofMatrix3x3.h:46
void operator-=(const ofMatrix3x3 &B)
Subtract matrix from existing matrix.
Definition ofMatrix3x3.cpp:183
float g
Definition ofMatrix3x3.h:31
void invert()
Definition ofMatrix3x3.cpp:111
float d
Definition ofMatrix3x3.h:28
ofMatrix3x3 operator-(const ofMatrix3x3 &B)
Subtract two matrices.
Definition ofMatrix3x3.cpp:169
void operator*=(const ofMatrix3x3 &B)
Multiply a matrix by a matrix this = this*B (in that order)
Definition ofMatrix3x3.cpp:214
float determinant() const
Find the determinant of the matrix.
Definition ofMatrix3x3.cpp:86
ofMatrix3x3 entrywiseTimes(const ofMatrix3x3 &A)
Multiply a matrix by a matrix entry by entry (i.e. a*a, b*b, c*c...)
Definition ofMatrix3x3.cpp:218
void transpose()
Transpose the matrix.
Definition ofMatrix3x3.cpp:62
void operator/=(const ofMatrix3x3 &B)
Definition ofMatrix3x3.cpp:279
friend std::ostream & operator<<(std::ostream &os, const ofMatrix3x3 &M)
Definition ofMatrix3x3.cpp:304
friend std::istream & operator>>(std::istream &is, ofMatrix3x3 &M)
Definition ofMatrix3x3.cpp:323
float c
Definition ofMatrix3x3.h:27
ofMatrix3x3 operator/(float scalar)
Divide a matrix through a scalar
Definition ofMatrix3x3.cpp:264
float i
Definition ofMatrix3x3.h:33
float & operator[](const int &index)
Definition ofMatrix3x3.cpp:38
ofMatrix3x3 operator+(const ofMatrix3x3 &B)
Add two matrices.
Definition ofMatrix3x3.cpp:140
float b
Definition ofMatrix3x3.h:26
void operator+=(const ofMatrix3x3 &B)
Add matrix to existing matrix.
Definition ofMatrix3x3.cpp:154
float a
Definition ofMatrix3x3.h:25