Take a look at the official documentation for libinput's coordinate transformation matrix: https://wayland.freedesktop.org/libinput/doc/1.1.0/group__config.html#ga09a798f58cc601edd2797780096e9804
Near the end it states that:
Note that any rotation requires an additional translation component to translate the rotated coordinates back into the original device space.
How are these translation components determined. The transformation matrix for rotating the coordinates 90 degrees anticlockwise is:
0 1 0
-1 0 1
0 0 0
The translation coordinates in this case are 0
and 1
.