No project description provided
Project description
miniglm
Minimalist pythonic matrix, vector, quaternion math.
Types
SCALAR
is a python floatVECTOR
is a tuple of three floatsQUATERNION
is a tuple of four floats (xyzw)MATRIX
is a tuple of nine floats (column-major)
Methods
add(a, b)
VECTOR VECTOR -> vector addition
VECTOR SCALAR -> (x, y, z) + s = (x+s, y+s, z+s)
sub(a, b)
VECTOR VECTOR -> vector subtraction
VECTOR SCALAR -> (x, y, z) - s = (x-s, y-s, z-s)
mul(a, b)
VECTOR SCALAR -> vector scaling by a scalar
VECTOR VECTOR -> element-wise multiplication
QUATERNION VECTOR -> quaternion scaling by a scalar
QUATERNION QUATERNION -> quaternion rotates a quaternion resulting in a quaternion
QUATERNION MATRIX -> quaternion rotates a matrix resulting in a matrix
MATRIX VECTOR -> matrix rotates a vector resulting in a vector
MATRIX QUATERNION -> matrix rotates a quaternion resulting in a quaternion
MATRIX MATRIX -> matrix rotates a matrix resulting in a matrix
mix(a, b, s)
SCALAR SCALAR -> simple mix of scalars
VECTOR VECTOR -> simple mix of vectors
QUATERNION QUATERNION -> quaternion rotation spherical interpolation (slerp)
MATRIX MATRIX -> matrix rotation spherical interpolation (slerp)
cross(a, b)
VECTOR VECTOR -> vector cross product
QUATERNION QUATERNION -> quaternion cross product
dot(a, b)
VECTOR VECTOR -> vector dot product
QUATERNION QUATERNION -> quaternion dot product
rotate(angle, axis)
SCALAR VECTOR -> rotation by angle radians along the axis resulting in a quaternion
split(a)
QUATERNION -> angle and axis suitable for rotate
MATRIX -> matrix columns
norm(a)
VECTOR -> vector normalize
QUATERNION -> quaternion normalize
MATRIX -> normalized quaternion derived from the matrix converted back to a matrix
length(a)
VECTOR -> vector length
QUATERNION -> quaternion length
inv(a)
QUATERNION -> inverse quaternion
MATRIX -> inverse matrix
det(a)
MATRIX -> matrix determinant
cast(a)
QUATERNION -> converts the quaternion to a matrix
MATRIX -> converts the matrix to a quaternion
swizzle(a, b, swizzle)
VECTOR -> swaps vector elements
QUATERNION -> swaps quaternion elements
pack(a)
SCALAR -> packed float resulting in 4 bytes
VECTOR -> packed vector resulting in 12 bytes
QUATERNION -> packed quaternion resulting in 16 bytes (xyzw)
MATRIX -> packed matrix resulting in 36 bytes (column-major)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
miniglm-0.3.3.tar.gz
(235.2 kB
view hashes)
Built Distribution
Close
Hashes for miniglm-0.3.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a44cf5180f14e6cf1eb1b8e89a39dbd8bff3a0423d2d61f105e5165552225b9 |
|
MD5 | 2303ba206787273fb3d5a72bf316fd8e |
|
BLAKE2b-256 | 90f5a01d4afd30a5cd5ae113b786f7290882301e93a776b4e35b2808d1e06f45 |