From f75b06869606036099a531bb0f54a0e3826b6272 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 3 Aug 2022 17:06:53 -0400 Subject: math: matrix: Add matrix4-inverse and matrix4-inverse! procedures. --- doc/api.texi | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') diff --git a/doc/api.texi b/doc/api.texi index 9afc853..bebef33 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -1134,6 +1134,13 @@ the given @var{matrices}. Note: Remember that matrix multiplication is @strong{not} commutative! @end deffn +@deffn {Procedure} matrix4-inverse matrix +Return the inverse of @var{matrix}. + +A matrix multiplied by its inverse is the identity matrix, thought not +always exactly due to the nature of floating point numbers. +@end deffn + @deffn {Procedure} orthographic-projection left right top bottom near far Return a new 4x4 matrix that represents an orthographic (2D) @@ -1180,6 +1187,11 @@ Multiply the 4x4 matrix @var{a} by the 4x4 matrix @var{b} and store the result in the 4x4 matrix @var{dest}. @end deffn +@deffn {Procedure} matrix4-inverse! matrix target +Compute the inverse of @var{matrix} and store the result in +@var{target}. +@end deffn + @deffn {Procedure} matrix4-translate! matrix x Modify @var{matrix} in-place to contain a translation by @var{x}, a 2D vector, a 3D vector, or a rectangle (in which case the bottom-left -- cgit v1.2.3