TA logoThe Technical Artist
Home/Field Notes/Math for TAs
cheat sheet
printable
ctrl+p -> one page

Math For TAs

reference~3 min readreviewed 2026-07-05

The dozen operations that carry the whole job. No proofs, no Greek - each one gets its formula, its plain-English meaning, and the production situations where it earns its keep.

Dot Product - "How Aligned?"

dot(A,B) = Ax - Bx + Ay - By + Az - Bz
With unit vectors: result = cos(angle). 1 same direction - 0 perpendicular - -1 opposite.
UseRecipe
Is it in front of me?dot(fwd, toTarget) > 0
Diffuse lightingsaturate(dot(N, L))
Fresnel / rim mask1 - dot(N, V)
Slope mask (flat ground)dot(N, up) > 0.7 ~= <45 deg

Cross Product - "Make Me An Axis"

cross(A,B) -> vector perpendicular to both - length = area of the parallelogram
Order matters: cross(A,B) = -cross(B,A). Flips with handedness - see units & axes.
UseRecipe
Face normal from 2 edgesnormalize(cross(e1, e2))
Build look-at basisright = cross(up, fwd)
Left-or-right of a line?sign of cross(lineDir, toPoint).z

Lerp & Inverse Lerp - "Blend / Unblend"

lerp(a,b,t) = a + (b-a) - t - where's t% between a and b
invLerp(a,b,v) = (v-a)/(b-a) - v is what % between a and b
UseRecipe
Any blend / fade / mixlerp(colorA, colorB, mask)
Distance -> 0-1 fadesaturate(invLerp(near, far, d))
Frame-rate-ish dampingpos = lerp(pos, target, 0.1) (per tick)

Remap - The TA Workhorse

remap(v, inA,inB, outA,outB) = lerp(outA, outB, invLerp(inA, inB, v))
= Houdini fit() - UE "Remap Value Range" - the function half your graphs secretly are.
UseRecipe
Noise -1..1 -> 0..1remap(n, -1,1, 0,1) or n - 0.5+0.5
Tri-count -> health scoreremap(tris, 0,budget, 100,0)

Smoothstep & Step - "Thresholds"

step(edge,x): 0 below, 1 at/above. Hard.
smoothstep(e0,e1,x): 0 below e0, 1 above e1, ease-curve between. Soft - and TAA-friendly, unlike step.
UseRecipe
Soft mask edgesmoothstep(0.45, 0.55, mask)
Dissolve frontiersmoothstep(p-w, p, noise)
Anti-shimmer contrastreplace step with narrow smoothstep

Normalize & Length - "Direction Vs Distance"

length(V) = sqrtdot(V,V) - normalize(V) = V / length(V)
Rule: normalize before you trust a direction - non-uniform scale un-normalizes normals and dot() lies after that.
Cheap trick: compare dot(V,V) against r^2 to skip the sqrt in distance checks.

The Quaternion Survival Paragraph

You don't need the math - you need the rules: quats are 4 numbers representing orientation, no gimbal lock, always slerp between them (never lerp euler angles across 180 deg), multiply to combine (order matters), negate = same rotation.
APIs that hand them to you: quaternion(axis, angle) (VEX) - Quaternion.LookRotation (Unity) - FQuat::FindBetween (UE). Use the API's from-to/look-at; hand-rolling is how ragdolls are born.

Constants & Conversions Taped To The Monitor

pi ~= 3.14159 - tau = 2pi ~= 6.28319 (one full turn)
degrees -> radians: - pi/180 (~= 0.01745) - radians -> degrees: - 57.2958
cos/sin of common angles: 45 deg -> 0.707 - 30 deg -> cos .866 / sin .5 - 60 deg -> cos .5 / sin .866
slope masks: dot(N,up) thresholds - 0.94~=20 deg - 0.87~=30 deg - 0.71~=45 deg - 0.5=60 deg
luminance (Rec.709): 0.2126R + 0.7152G + 0.0722B

Want these with more story? The HLSL page teaches the five shader functions through effects; the Python snippets carry the same family as copy-paste code; and the interview bank shows how dot/cross questions get asked and answered. Print tip: Ctrl+P - the site chrome disappears and the cards pack onto a page.