Module /math #
Mathematical constants (pi, e, phi) complementing the prelude transcendental math functions.
(use /math)
e #
Constant (Any)
Euler's number e
phi #
Constant (Any)
The golden ratio φ
pi #
Constant (Any)
Archimedes' constant π
Module /num #
Numeric interpolation (lerp) and rounding helpers (round-to-multiple).
(use /num)
lerp #
(a b t)
Exported function in /num.
round-to-multiple #
(n m)
Round a number to the nearest m multiple. Extra decimals are truncated (floor behavior).
Module /statistics #
Descriptive statistics: mean, median, variance, standard deviation, min/max, and linear regression.
(use /statistics)
absolute-difference #
(x y)
Exported function in /statistics.
compute-max #
(xs)
Exported function in /statistics.
compute-min #
(xs)
Exported function in /statistics.
compute-sum #
(xs)
Exported function in /statistics.
difference #
(x y)
Exported function in /statistics.
mean #
(xs)
Exported function in /statistics.
mean-absolute-deviation #
(xs)
Exported function in /statistics.
population-standard-deviation #
(xs)
Exported function in /statistics.
population-variance #
(xs)
Exported function in /statistics.
relative-change #
(x x-ref)
Exported function in /statistics.
rolling-mean #
(window-size xs)
Exported function in /statistics.
rolling-standard-deviation #
(window-size xs)
Exported function in /statistics.
sample-standard-deviation #
(xs)
Exported function in /statistics.
sample-standard-deviation-given-mean #
(xs m)
Exported function in /statistics.
sample-variance #
(xs m)
Exported function in /statistics.
sample-variance-given-mean #
(xs m)
Exported function in /statistics.
weighted-mean #
(xs ws)
Compute the weighted arithmetic mean.
Module /mat #
4x4 homogeneous floating-point matrix math (Mat4) for 3D transforms, projections, rotations, and inversions.
(use /mat)
* #
(a b)
Matrix multiplication (4x4 * 4x1) = 4x1
Mat4 #
(r1 r2 r3 r4)
Exported function in /mat.
Mat4-one #
(angle)
Exported function in /mat.
Mat4-projection #
(fov aspect near far)
Exported function in /mat.
Mat4-rotation-x #
(angle)
Exported function in /mat.
Mat4-rotation-y #
(angle)
Exported function in /mat.
Mat4-rotation-z #
(angle)
Exported function in /mat.
Mat4-translation #
(tx ty tz)
Exported function in /mat.
Mat4-zero #
(angle)
Exported function in /mat.
put #
(m i j value)
Exported function in /mat.
Module /simd #
Portable 128-bit SIMD vector types (F32x4, F64x2, I32x4, I64x2, U8x16) and lane-parallel arithmetic.
(use /simd)
F32x4 #
(Func Any Any)
Exported function in /simd.
F64x2 #
(Func Any Any)
Exported function in /simd.
I32x4 #
(Func Any Any)
Exported function in /simd.
I64x2 #
(Func Any Any)
Exported function in /simd.
U8x16 #
(Func Any Any)
Exported function in /simd.
abs #
(Func Any Any)
Exported function in /simd.
add-float-arrays #
(Func Any Any)
Exported function in /simd.
all-true? #
(Func Any Any)
Exported function in /simd.
any-true? #
(Func Any Any)
Exported function in /simd.
clamp #
(Func Any Any)
Exported function in /simd.
dot #
(dot a b) -> Float
Computes the dot product of two SIMD vectors.
dot-float-arrays #
(Func Any Any)
Exported function in /simd.
dot-int-arrays #
(Func Any Any)
Exported function in /simd.
fast-inv #
(Func Any Any)
Exported function in /simd.
fast-inv-sqrt #
(Func Any Any)
Exported function in /simd.
fma #
(Func Any Any)
Exported function in /simd.
lane-at #
(Func Any Any)
Exported function in /simd.
max #
(Func Any Any)
Exported function in /simd.
min #
(Func Any Any)
Exported function in /simd.
product #
(Func Any Any)
Exported function in /simd.
reduce-max #
(Func Any Any)
Exported function in /simd.
reduce-min #
(Func Any Any)
Exported function in /simd.
select #
(Func Any Any)
Exported function in /simd.
simd-eq #
(Func Any Any)
Exported function in /simd.
simd-ge #
(Func Any Any)
Exported function in /simd.
simd-gt #
(Func Any Any)
Exported function in /simd.
simd-le #
(Func Any Any)
Exported function in /simd.
simd-lt #
(Func Any Any)
Exported function in /simd.
simd-ne #
(Func Any Any)
Exported function in /simd.
splat #
(splat val) -> Simd128
Broadcasts a scalar number into all lanes of a 128-bit SIMD vector.
(use /simd)
(let v (f32x4/splat 1.0))
sqrt #
(Func Any Any)
Exported function in /simd.
sum #
(sum vec) -> Number
Performs horizontal sum across all lanes of a SIMD vector.
sum-float-array #
(Func Any Any)
Exported function in /simd.
sum-int-array #
(Func Any Any)
Exported function in /simd.
swizzle #
(Func Any Any)
Exported function in /simd.
to-array #
(Func Any Any)
Exported function in /simd.
to-bitmask #
(Func Any Any)
Exported function in /simd.
to-float-array #
(Func Any Any)
Exported function in /simd.
with-lane #
(Func Any Any)
Exported function in /simd.
zero #
(Func Any Any)
Exported function in /simd.
Module /rng #
Pseudo-random number generation (random, random-float) for integers, floats, and ranges.
(use /rng)
random #
(random ...)
Exported function in /rng.
random-float #
(random-float ...)
Exported function in /rng.
Module /image #
In-memory raster image representation (Image) with format detection, cropping, and Lanczos3/bilinear resizing.
(use /image)
Image #
(Image ...)
Exported function in /image.
crop #
(crop ...)
Exported function in /image.
detect-format #
(detect-format ...)
Exported function in /image.
resize #
(resize ...)
Exported function in /image.
Module /image/avif #
AVIF image decoder and encoder supporting files and byte slabs.
(use /image/avif)
Coder #
(Coder ...)
Exported function in /image/avif.
decode-from-file #
(decode-from-file ...)
Exported function in /image/avif.
decode-from-slab #
(decode-from-slab ...)
Exported function in /image/avif.
encode-to-file #
(encode-to-file ...)
Exported function in /image/avif.
encode-to-slab #
(encode-to-slab ...)
Exported function in /image/avif.
write #
(write ...)
Exported function in /image/avif.
Module /image/jpeg #
JPEG image decoder and encoder supporting quality configuration, files, and byte slabs.
(use /image/jpeg)
Coder #
(Coder ...)
Exported function in /image/jpeg.
decode-from-file #
(decode-from-file ...)
Exported function in /image/jpeg.
decode-from-slab #
(decode-from-slab ...)
Exported function in /image/jpeg.
encode-to-file #
(encode-to-file ...)
Exported function in /image/jpeg.
encode-to-slab #
(encode-to-slab ...)
Exported function in /image/jpeg.
write #
(write ...)
Exported function in /image/jpeg.
Module /image/png #
Lossless PNG image decoder and encoder supporting files and byte slabs.
(use /image/png)
Coder #
(Coder ...)
Exported function in /image/png.
decode-from-file #
(decode-from-file ...)
Exported function in /image/png.
decode-from-slab #
(decode-from-slab ...)
Exported function in /image/png.
encode-to-file #
(encode-to-file ...)
Exported function in /image/png.
encode-to-slab #
(encode-to-slab ...)
Exported function in /image/png.
write #
(write ...)
Exported function in /image/png.
Module /image/webp #
WebP image decoder and encoder supporting files and byte slabs.
(use /image/webp)
Coder #
(Coder ...)
Exported function in /image/webp.
decode-from-file #
(decode-from-file ...)
Exported function in /image/webp.
decode-from-slab #
(decode-from-slab ...)
Exported function in /image/webp.
encode-to-file #
(encode-to-file ...)
Exported function in /image/webp.
encode-to-slab #
(encode-to-slab ...)
Exported function in /image/webp.
write #
(write ...)
Exported function in /image/webp.