Skip to main content

miniglm

Minimalist pythonic matrix, vector, quaternion math.

Types

  • SCALAR is a python float
  • VECTOR is a tuple of three floats
  • QUATERNION 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)

normalize(a)
    VECTOR -> vector normalize
    QUATERNION -> quaternion normalize
    MATRIX -> normalized quaternion derived from the matrix converted back to a matrix

inverse(a)
    QUATERNION -> inverse quaternion
    MATRIX -> inverse matrix

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)

Metadata

Release files for miniglm 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for miniglm 0.3.0
File Size Uploaded Provenance Actions
miniglm-0.3.0.tar.gz 3.3 kB Without provenance Details for miniglm-0.3.0.tar.gz

Release files / miniglm-0.3.0.tar.gz

Download URL miniglm-0.3.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6ebd50efebdd91df4e6df293d2c37e44441e838b07cfd279290bf030a3c6e787
BLAKE2b-256 checksum
How to use checksums
26bd658909dd14ace953a216cd85fe4e21bb889df3b33580a7389993f29ec342
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Security for miniglm 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page