rtgmath
20191007
A selection of the math routines most commonly needed for realtime graphics in lisp
Upstream URL
Author
Chris Bagley <techsnuffle@gmail.com>
License
BSD 2 Clause
rtgmath
This system provides a selection of the math routines most commonly needed for making realtime graphics in lisp.
Feature Shortlist
The library provides:

2, 3 & 4 component vectors (vec2, vec3, vec4), including support for:
 unit, zero & equality predicates
 addition, subtraction, multiplication & divising of vectors against each other
 addition, subtraction, multiplication & divising of scalars against vectors
 length, lengthsquared, distance, distancesquared
 dot, absolutedot & cross products
 normalize
 lerp, bezier & spline
 Consing and nonconsing apis
 Optional generic API

3x3 & 4x4 matrices (
mat3
,mat4
), including support for: identity, zero & equality predicates
 componentwise addition & subtraction of matrices
 multiplication of matrices with matrices and matrices with vectors
 transpose, adjoint, determinate, trace
 construction from angle (seperately or as a vec3), axisangle, scale, or individual components
 inverse & affineinverse
 extraction of rows or columns as vectors
 Consing and nonconsing apis
 Optional generic API

Quaternions
 addition, subtraction, multiplication & divising of quaternions against each other
 conversion from & to 3x3 matrices, axisangle pairs, lookat position & more
 magnitude, norm, normalize, conjugate, inverse
 lerp & slerp

Basic support for spherical and polar coordinates
And more for all categories.
Documentation
Reference docs can be found here
All the symbols with documentation in the above reference docs als ohave identical docstrings and so this can be easily queried from your editor.
CHANGELOG
20180418
 WARNING: Fixes to fromdirection, projection & lookat matrices. Will have import of projects using this lib
20180328
 Ported all the API (except regions for now) to Vari so rtgmath works on the GPU.
20170909
 WARNING: Fix to perspective matrix, will have impact on project using this lib.
20170428
 all lerp functions are stable, stablelerp is deprecated & will be removed in a future release
20170411
 Fixes to the projection matrices. Are also now typed
20170213
 Add nonconsing functions for matrix3 & matrix4
20170212
 Started Changelog. Sorry we havent had this before.
 Most of vector, matrix, quaternion API is now typed
 Where possible the optimization for the public is set at (speed 3) (safety 1) (debug 1)
 I have started adding a nonconsing version of the apis. The nicknames for these packages is the regular nickname with
n
on the end. Therefore:  rtgmath.vector2.nonconsing has the nickname v2n
 rtgmath.vector3.nonconsing has the nickname v3n
 rtgmath.vector4.nonconsing has the nickname v4n
 rtgmath.matrix2.nonconsing has the nickname m2n
 rtgmath.matrix3.nonconsing has the nickname m3n
 rtgmath.quaternions.nonconsing has the nickname qn
 q:qconjugate is now deprecated in favor q:conjugate.
 directory structure normalized a bit. Now vectors/matrices/quaternions
 fixed spelling mistake in m3: determinate > determinant
 added the regions api support lines, rays, linesegments & axisaligned boxes in ℝ3