URL: https://graphicscomputing.fr/cgp/reference/mat2/
Description: 2x2 matrix of floats.

# mat2

C++ type: `matrix_stack<float,2,2>`.
2x2 matrix of floats.

Fields:

- `numarray_stack<numarray_stack<float,2>,2> data` - Coefficients stored row by row as 2 rows of 2 floats, contiguous in memory.

Functions taking it:

- `std::string type_str(mat2 const&)` - Type name as a string: "mat2".
- `float det(mat2 const& m)` - Determinant of a 2x2 matrix.
- `mat2 inverse(mat2 const& m)` - Matrix inverse.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, mat2 const& m, bool expected = true)` - Send a mat2 uniform (row-major, transposed on upload) to the shader; warns if the uniform is not found and expected is true.

Functions returning it:

- `mat2 tensor_product(vec2 const& a, vec2 const& b)` - Outer product a * transpose(b), as a 2x2 matrix.
