Skip to content
Shapemetry

Model - Transformation functions

Every function callable as Transformation.* inside an expression — an argument input, a parameter binding, a table cell. Pure: no side effects, no async.

FunctionReturnsDescriptionArgTypeMeaning
Transformation.apply(m, point)pointApply the transform to a point (translation included).mtransformthe matrix
pointpointthe point
Transformation.applyVector(m, vector)vectorApply the transform's linear part only to a direction (no translation).mtransformthe matrix
vectorvectorthe direction
Transformation.compose(a, b)transformCompose two transforms: compose(a,b) applies b first, then a (apply(compose(a,b),p) === apply(a,apply(b,p))).atransformapplied second
btransformapplied first
Transformation.invert(m)transformMatrix inverse. Throws for a singular (non-invertible) input — there is no inverse to return.mtransformthe matrix
Transformation.rotation(axisOrigin, axisDirection, angleDeg)transformRotation matrix about an axis (origin + direction).axisOriginpointa point on the rotation axis
axisDirectionvectorthe rotation axis direction (any magnitude)
angleDeganglerotation angle, degrees
Transformation.scaling(sx, sy, sz)transformPure scaling matrix about the origin.sxnumberscale factor, x
synumberscale factor, y
sznumberscale factor, z
Transformation.translation(vector)transformPure translation matrix.vectorvectortranslation vector
Last updated: 📖 1 min readEdit on GitHub