Installation
Clamping operations
Utilities for constraining numeric values within specified ranges.clamp
Clamps a value between a minimum and maximum.clampWithOverflow
Clamps a value with wrapping overflow behavior.clampWithOverflow wraps values that exceed the range back into the valid range, making it useful for circular buffers and cyclic operations.Vector2
A 2D vector type with comprehensive operations.Types
Construction
- of
- zero
- copy
Creates a new vector from x and y coordinates.
Arithmetic operations
- Addition
- Subtraction
- Multiplication
- Division
Manipulation
- negate
- snap
- clamp
Negates both components of a vector.
Utility
Rectangle
Rectangle type and operations for 2D bounding boxes.Types
Construction
- of
- ofBounds
- fromDOM
Creates a rectangle from position and size vectors.
Operations
- expand
- center
- overlaps
Expands rectangle to include another rectangle.