Identity sets the matrix to the Identity matrix and returns the matrix.
()
| 176 | |
| 177 | // Identity sets the matrix to the Identity matrix and returns the matrix. |
| 178 | func (m *Matrix) Identity() *Matrix { |
| 179 | m.Val[m00] = 1 |
| 180 | m.Val[m10] = 0 |
| 181 | m.Val[m20] = 0 |
| 182 | m.Val[m01] = 0 |
| 183 | m.Val[m11] = 1 |
| 184 | m.Val[m21] = 0 |
| 185 | m.Val[m02] = 0 |
| 186 | m.Val[m12] = 0 |
| 187 | m.Val[m22] = 1 |
| 188 | return m |
| 189 | } |
| 190 | |
| 191 | // Multiply postmultiplies m matrix with m2 and stores the result in m, returning m. |
| 192 | // Multiplaction is the result of m2 times m. |
no outgoing calls
no test coverage detected