class methods

- ofMatrix3x3()
- determinant()
- entrywiseTimes()
- inverse()
- invert()
- operator*()
- operator*=()
- operator+()
- operator+=()
- operator-()
- operator-=()
- operator/()
- operator/=()
- operator[]()
- set()
- transpose()

variables

The 3x3 matrix can hold the values needed to transform a 2d vertex, which is pretty handy when you want to do things like move vertices around, rotate them, etc. The 3x3 is pretty important because it allows you to have both a rotation and a transformation in the same little old object. You won't see them used a great deal because it's usually easier to use the rotate() and translate() methods of ofVec2f but they are handy sometimes. You'll probably see the ofMatrix4x4 used more often, because it allows you to represent a camera or a projection mathematically, and that's pretty useful in doing 3d graphics. They're also used in ofxOpenCv sometimes to represent information about cameras.

*Documentation from code comments*

*Documentation from code comments*

A 3x3 Matrix

The layout is like this:

```
[ a b c ]
[ d e f ]
[ g h i ]
```

# ofMatrix3x3(...)

## ofMatrix3x3::ofMatrix3x3(float _a, float _b, float _c, float _d, float _e, float _f, float _g, float _h, float _i)

*Documentation from code comments*

*Documentation from code comments*

\name Constructor {

# determinant()

## float ofMatrix3x3::determinant()

# entrywiseTimes(...)

## ofMatrix3x3 ofMatrix3x3::entrywiseTimes(const ofMatrix3x3 &A)

*Documentation from code comments*

*Documentation from code comments*

Multiply a matrix by a matrix entry by entry (i.e. a*a, b*b, c*c...)

This is referred to as an entrywise, Hadamard, or Schur product.

# inverse(...)

## ofMatrix3x3 ofMatrix3x3::inverse(const ofMatrix3x3 &A)

*Documentation from code comments*

*Documentation from code comments*

Inverse of a 3x3 matrix

the inverse is the adjoint divided through the determinant find the matrix of minors (minor = determinant of 2x2 matrix of the 2 rows/colums current element is NOT in) turn them in cofactors (= change some of the signs) find the adjoint by transposing the matrix of cofactors divide this through the determinant to get the inverse

See also: invert();

# operator*(...)

## ofMatrix3x3 ofMatrix3x3::operator*(const ofMatrix3x3 &B)

*Documentation from code comments*

*Documentation from code comments*

Multiply a 3x3 matrix with a 3x3 matrix

# operator*(...)

## ofMatrix3x3 ofMatrix3x3::operator*(float scalar)

*Documentation from code comments*

*Documentation from code comments*

Multiply a matrix with a scalar

# operator*=(...)

## void ofMatrix3x3::operator*=(const ofMatrix3x3 &B)

*Documentation from code comments*

*Documentation from code comments*

Multiply a matrix by a matrix this = this*B (in that order)

# operator*=(...)

## void ofMatrix3x3::operator*=(float scalar)

*Documentation from code comments*

*Documentation from code comments*

Multiply a matrix by a scalar (multiples all entries by scalar)

# operator+(...)

## ofMatrix3x3 ofMatrix3x3::operator+(const ofMatrix3x3 &B)

*Documentation from code comments*

*Documentation from code comments*

Add two matrices

# operator+=(...)

## void ofMatrix3x3::operator+=(const ofMatrix3x3 &B)

*Documentation from code comments*

*Documentation from code comments*

Add matrix to existing matrix

# operator-(...)

## ofMatrix3x3 ofMatrix3x3::operator-(const ofMatrix3x3 &B)

*Documentation from code comments*

*Documentation from code comments*

Subtract two matrices

# operator-=(...)

## void ofMatrix3x3::operator-=(const ofMatrix3x3 &B)

*Documentation from code comments*

*Documentation from code comments*

Subtract matrix from existing matrix

# operator/(...)

## ofMatrix3x3 ofMatrix3x3::operator/(float scalar)

*Documentation from code comments*

*Documentation from code comments*

Divide a matrix through a scalar

# set(...)

## void ofMatrix3x3::set(float _a, float _b, float _c, float _d, float _e, float _f, float _g, float _h, float _i)

*Documentation from code comments*

*Documentation from code comments*

\name Matrix access {

# transpose()

## void ofMatrix3x3::transpose()

*Documentation from code comments*

*Documentation from code comments*

Transpose the matrix

This changes the matrix.

```
[ a b c ]T [ a d g ]
[ d e f ] = [ b e h ]
[ g h i ] [ c f i ]
```

# transpose(...)

## ofMatrix3x3 ofMatrix3x3::transpose(const ofMatrix3x3 &A)

*Documentation from code comments*

*Documentation from code comments*

Transpose without changing the matrix. Uses the "swap" method with additions and subtractions to swap the elements that aren't on the main diagonal.

Returns: transposed matrix.

Last updated Sunday, 22 January 2017 18:53:11 UTC - d7a60ecc97884273248a4d3f4bf250a4b5a04071

Hosting for openFrameworks is generously provided by Rackspace

If you have any doubt about the usage of this module you can ask in the forum.

If you want to contribute better documentation or start documenting this section you can do so here

If you find anything wrong with this docs you can report any error by opening an issue