Reference

Math & engineering notation

Look up symbols, units, probability, vectors and engineering formulas.

Scope and conventions

Common mathematical and engineering notation, with domains, units and assumptions. Estimates and idealized models are labeled; check their assumptions against the system you are describing.

Vectors & change

Read a vector and its dot product

Notation & units

A vector is an ordered collection of coordinates. The dot product multiplies corresponding coordinates and adds them.

Fragment

Notation & units · Read a vector and its dot product
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
x = (x₁, ..., x_d)
x · y = Σ(i=1..d) xᵢyᵢ
(1,2) · (3,4) = 11

The vectors must have compatible dimensions.

Magnitude and cosine similarity

Notation & units

The Euclidean norm is the square root of the sum of squared coordinates. Cosine similarity compares direction for nonzero vectors.

Fragment

Notation & units · Magnitude and cosine similarity
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
||x||₂ = sqrt(Σi xᵢ²)
cosine(x,y) = (x·y) / (||x||₂ ||y||₂)

Cosine is undefined when either vector has zero norm. Similarity is not a probability.

Check matrix dimensions

Notation & units

A matrix-vector product maps an n-coordinate input to an m-coordinate output. Matrix multiplication requires matching inner dimensions.

Fragment

Notation & units · Check matrix dimensions
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
A: m×n, x: n×1 -> Ax: m×1
A: m×n, B: n×p -> AB: m×p

AB and BA generally differ; one may not even be defined.

Read rate of change and gradients

Notation & units

A derivative is local rate of change. A gradient collects partial derivatives of a scalar function with respect to its coordinates.

Fragment

Notation & units · Read rate of change and gradients
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
d(x²)/dx = 2x
∇f = (∂f/∂x₁, ..., ∂f/∂x_d)
x_next = x - η∇f(x)

Gradient descent uses a step size η; this rule alone does not guarantee convergence.

Normalize scores into positive weights

Notation & units

Softmax turns finite real scores into positive weights summing to one. Subtracting the maximum score improves numerical stability without changing the mathematical result.

Fragment

Notation & units · Normalize scores into positive weights
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
pᵢ = exp(zᵢ-m) / Σj exp(zⱼ-m)
m = max_j zⱼ

These weights are not automatically calibrated probabilities about the world.

Transpose a matrix

Notation & units

Transpose swaps rows and columns. The order of factors reverses when transposing a matrix product.

Fragment

Notation & units · Transpose a matrix
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
If A is m×n, Aᵀ is n×m
(Aᵀ)ᵢⱼ = Aⱼᵢ
(AB)ᵀ = BᵀAᵀ

For complex matrices, conjugate transpose A* or Aᴴ also conjugates entries; it is a different operation.

Read limits and accumulated change

Notation & units

A limit describes a value approached as the input approaches a point. A definite integral accumulates signed contributions over an interval; for continuous rate functions, it gives total change.

Fragment

Notation & units · Read limits and accumulated change
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
lim(x→a) f(x) = L
∫[a..b] f(x) dx
If F′ = f, ∫[a..b] f(x) dx = F(b)-F(a)

A function need not equal its limit at a point. Units multiply by the integration variable’s units.

Relate angles, radians and periodic functions

Notation & units

Radians measure arc length divided by radius. A full turn is 2π radians. Standard calculus identities for sine/cosine assume radian inputs.

Fragment

Notation & units · Relate angles, radians and periodic functions
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
180° = π radians
90° = π/2 radians
sin²(θ) + cos²(θ) = 1
sin(θ + 2π) = sin(θ)

Check degree/radian conventions when using a native math API.

Normalize a value within a range

Notation & units

Linear interpolation combines endpoints with a weight. Rescaling to [0,1] uses a nonzero range width; extrapolation occurs outside that interval.

Fragment

Notation & units · Normalize a value within a range
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
lerp(a,b,t) = a + t(b-a)
normalize(x,a,b) = (x-a)/(b-a), a ≠ b

This formula does not clamp. Choose an explicit policy for equal endpoints and out-of-range inputs.