Matrix math is used to render things on a computer screen. This is common throughout computer graphics, for examples and primers on using matrix math to render things to screens please read an OpengGL tutorial.
In wlroots we primarily use a 3x3 matrix of 32 bit floating point values to represent a 2D screen. We also provide basic helper functions to assist in transforming the matrices.
Multiply two matrices together.
Shortcut for the various matrix operations involved in projecting the specified wlr_box onto a given orthographic projection with a given rotation. The result can be applied to each coordinate of the box to get a new coordinate from [-1,1].
Create a 2D orthographic projection matrix of (width, height) with a
Rotate the matrix by some amount of radians.
Scales the 2D matrix to a magnitude of (x, y).
Transform the matrix based on the given Wayland output transform mode.
Translate the 2D matrix to a magnitude of (x, y).
Flip the values over the diagonal of a matrix