Source code for simvx.core.math

"""Math utilities: NumPy-based vector, quaternion, matrix, and geometry types."""

from .aabb import AABB
from .curves import Curve
from .matrices import (
    batch_mat4_from_trs,
    identity,
    look_at,
    mat4_from_trs,
    mat4_to_bytes,
    orthographic,
    perspective,
    quat_to_mat4,
    rotate,
    scale,
    translate,
)
from .raycast import ray_intersect_sphere, screen_to_ray
from .rect2 import Rect2
from .transforms import Basis, Transform2D, Transform3D
from .types import (
    Curve2D,
    Curve3D,
    Quat,
    Vec2,
    Vec3,
    clamp,
    cross,
    dot,
    length,
    mix,
    normalize,
    slerp,
)

__all__ = [
    # Matrix operations
    "identity",
    "perspective",
    "look_at",
    "translate",
    "rotate",
    "scale",
    "orthographic",
    "quat_to_mat4",
    "mat4_from_trs",
    "batch_mat4_from_trs",
    "mat4_to_bytes",
    # Raycast
    "ray_intersect_sphere",
    "screen_to_ray",
    # Vector/Quat types
    "Vec2",
    "Vec3",
    "Quat",
    "Curve",
    "Curve2D",
    "Curve3D",
    # Geometry & transforms
    "Rect2",
    "AABB",
    "Transform2D",
    "Basis",
    "Transform3D",
    # Utility functions
    "normalize",
    "length",
    "dot",
    "cross",
    "mix",
    "clamp",
    "slerp",
]