Lua Math Library Fight! Last updated 2024-06-25.
| GLSL | Batteries | Be1zeVector | Brine | CPML | Hump | Lmath | Lua-Quaternion | LuvVectors | Maf | Mathsies | MikuVec | MGL | Radda3D | Russet | Tvec | Vectoring | Vornmath |
whole library size (code only) | n/a | 107kB | 5kB | 8kB | 163kB | 33kB | 26kB | 4kB | 4kB | 8kB | 25kB | 13kB | 111kB | 28kB | 28kB | 9kB | 6kB | 152kB |
vector math component size | n/a | 34kB | 5kB | 8kB | 80kB | 12kB | 25kB | 4kB | 4kB | 8kB | 25kB | 13kB | 111kB | 28kB | 27kB | 9kB | 6kB | 152kB |
unit test coverage | n/a | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✓ | ✗ | ✓ |
ffi compatibility | n/a | ✗ | ✗ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ |
garbage control | n/a | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ | ✓ |
last update | 2018-06-14 | 2024-05-07 | 2023-08-30 | 2022-08-21 | 2022-05-07 | 2021-03-23 | 2021-07-01 | 2019-06-19 | 2023-08-07 | 2019-07-08 | 2024-03-01 | 2018-07-27 | 2021-01-30 | 2024-06-06 | 2023-08-07 | 2023-08-29 | 2021-08-28 | 2024-05-20 |
vec2 | ✓ | ✓ | ✗ | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
vec3 | ✓ | ✓ | ✓ | ✗ | ✓ | ✗ | ✓ | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ | ✓ | ✓ |
vec4 | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ | ✗ | ✗ | ✓ | ✓ |
component access | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
array access | ✓ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ |
swizzle read | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ |
swizzle write | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ |
alternative components | ✓ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ |
scalar-vector operators | ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✓ | ✓ | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
vector * scalar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
componentwise operators | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
componentwise functions | ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ |
mat2 | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ |
mat3 | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ |
mat4 | ✓ | ✗ | ✗ | ✗ | ✓ | ✗ | ✓ | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | ✓ |
non-square matrices | 1.2 | N/A | N/A | N/A | ✗ | ✗ | ✗ | ✗ | N/A | N/A | ✗ | ✓ | ✓ | ✗ | N/A | ✗ | N/A | ✓ |
sendable matrices | N/A | N/A | N/A | N/A | ✓ | ✗ | ✓ | ✗ | N/A | N/A | ✗ | ✗ | ✓ | ✓ | N/A | ✗ | N/A | ✓ |
columns as vectors | ✓ | N/A | N/A | N/A | ✗ | ✗ | ✗ | ✗ | N/A | N/A | ✗ | ✓ | ✓ | ✗ | N/A | ✗ | N/A | ✓ |
hyperbolic functions | 1.4 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ |
bvecs | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ |
vector construct from table | N/A | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✓ | ✗ | ✗ |
vector copy construct | ✓ | ✓ | ✗ | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ | ✓ | ✗ | ✗ | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
vec2 polar construct | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✗ | ✗ | N/A | N/A | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ |
vector demote | ✓ | ✓ | ✗ | ✗ | ✓ | ✗ | ✓ | ✗ | N/A | N/A | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ |
vector mixed construct | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ |
matrix construct from table | N/A | N/A | N/A | N/A | ✓ | ✗ | ✗ | ✗ | N/A | N/A | ✗ | ✗ | ✓ | ✗ | N/A | ✗ | N/A | ✗ |
matrix copy construct | ✓ | N/A | N/A | N/A | ✓ | ✗ | ✓ | ✗ | N/A | N/A | ✗ | ✗ | ✓ | ✗ | N/A | ✗ | N/A | ✓ |
matrix vector construct | ✓ | N/A | N/A | N/A | ✓ | ✗ | ✗ | ✗ | N/A | N/A | ✗ | ✗ | ✓ | ✗ | N/A | ✗ | N/A | ✓ |
matrix mixed construct | ✓ | N/A | N/A | N/A | ✗ | ✗ | ✗ | ✗ | N/A | N/A | ✗ | ✗ | ✗ | ✗ | N/A | ✗ | N/A | ✓ |
matrix upsize construct | ✓ | N/A | N/A | N/A | ✓ | ✗ | ✗ | ✗ | N/A | N/A | ✗ | ✗ | ✓ | N/A | N/A | ✗ | N/A | ✓ |
transform factories | ✗ | N/A | N/A | N/A | ✓ | ✗ | ✓ | ✗ | N/A | N/A | ✗ | ✗ | ✓ | ✗ | N/A | ✗ | N/A | ✗ |
camera factories | ✗ | N/A | N/A | N/A | ✓ | ✗ | ✓ | ✗ | N/A | N/A | ✓ | ✗ | ✓ | ✓ | N/A | ✗ | N/A | ✗ |
vector bitwise operators | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
mix et al | ✓ | ✓ | ✓ | ✗ | ✓ | ✗ | ✓ | ✗ | mix | ✓ | ✗ | ✓ | ✗ | ✗ | clamp | clamp | mix | ✗ |
optical functions | ✓ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | reflect | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ |
vector relational functions | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | min/max | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
matrix direct access | ✗ | N/A | N/A | N/A | ✓ | ✗ | ✓ | ✗ | N/A | N/A | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | N/A | ✓ |
matrix transpose | 1.2 | N/A | N/A | N/A | ✓ | ✗ | ✓ | ✗ | N/A | N/A | ✓ | ✗ | ✓ | ✓ | ✗ | ✗ | N/A | ✓ |
matrix inverse | 1.4 | N/A | N/A | N/A | ✓ | ✗ | ✓ | ✗ | N/A | N/A | ✓ | ✗ | ✓ | ✓ | ✗ | ✗ | N/A | ✓ |
isinf and isnan | 1.3 | ✓ | ✗ | ✗ | isnan | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
rounding | 1.3 | ✓ | ✗ | ✗ | ✓ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | floor/ceil | ✗ | ✗ | ✗ | ✗ | ✗ | floor/ceil |
matrix determinant | 1.5 | N/A | N/A | N/A | ✓ | ✗ | ✗ | ✗ | N/A | N/A | ✓ | ✗ | ✓ | ✓ | N/A | ✗ | N/A | ✓ |
color packing functions | 4 | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
color conversion functions | ✗ | ✓ | ✗ | ✗ | | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ |
bitfield functions | 4 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
complex numbers | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ |
polar complex | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | ✗ |
complex math functions | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | ✓ |
cvec | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | ✓ |
cmat | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | ✓ |
quaternions | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✓ | ✗ | ✓ | ✓ | ✗ | ✗ | ✓ | ✗ | ✗ | as vec4 | ✓ |
quaternion from angle axis | ✗ | N/A | N/A | N/A | ✓ | N/A | N/A | ✓ | N/A | ✓ | ✓ | N/A | N/A | ✓ | N/A | N/A | ✗ | ✓ |
quaternion to matrix | ✗ | N/A | N/A | N/A | ✓ | N/A | ✓ | ✗ | N/A | N/A | ✗ | N/A | N/A | ✗ | N/A | N/A | N/A | ✓ |