Lines, planes, and spheres in $\mathbb{R}^n$

linear-algebravectorsgeometry

Points and lines

A point in $\mathbb{R}^n$ is just a vector $x = (x_1,\dots,x_n)$. A line through $p$ in direction $d \neq 0$:

$$ x = p + td, \quad t \in \mathbb{R}. $$

$d$ is the direction $x$ travels; $p$ is the point $x$ passes through at $t=0$. That is all this equation says.

Intuition: one free parameter $t$ sweeps out a straight, 1-dimensional path.

Shapes

$$ \underbrace{x}_{n\times1}=\underbrace{p}_{n\times1}+t\,\underbrace{d}_{n\times1}, \qquad t\in\mathbb{R}. $$

Intuition: $x$, $p$, and $d$ are all columns of the same height $n$; $t$ is just a single dial that slides the point along the fixed direction $d$.

Example

$$ p = \begin{pmatrix}1\\0\end{pmatrix}, \ d = \begin{pmatrix}1\\1\end{pmatrix} \;\Rightarrow\; x(t) = \begin{pmatrix}1+t\\t\end{pmatrix}. \quad x(0) = \begin{pmatrix}1\\0\end{pmatrix}, \ x(1) = \begin{pmatrix}2\\1\end{pmatrix}. $$

Hyperplanes

Choose a point $p$ on the hyperplane. The normal vector $n \neq 0$ is perpendicular to every vector $x - p$ lying in the hyperplane, for any other point $x$ on it:

$$ n \cdot (x - p) = 0 \quad \iff \quad n \cdot x = n \cdot p =: c. $$

One linear equation removes one degree of freedom, so a hyperplane in $\mathbb{R}^n$ is $(n{-}1)$-dimensional: a line when $n=2$, an ordinary plane when $n=3$.

Intuition: a hyperplane is "everything at a fixed distance along one direction," flat, and one dimension smaller than the space it sits in.

Shapes

$$ \underbrace{n^T}_{1\times n}\underbrace{x}_{n\times1}=\underbrace{c}_{1\times1}. $$

Intuition: $n\cdot x$ is secretly a $1\times n$ row times an $n\times1$ column, collapsing $n$ numbers down to one; every dot product in this post has this same row-times-column shape.

Example

$$ p = \begin{pmatrix}0\\0\\1\end{pmatrix}, \ n = \begin{pmatrix}1\\1\\1\end{pmatrix} \;\Rightarrow\; x+y+z = 1. \quad (0,0,1) \text{ and } (1,0,0) \text{ both satisfy it.} $$

Spheres

Points at a fixed distance from a center: the first curved (non-flat) object here.

$$ \|x - c\| = r \quad \iff \quad (x-c)\cdot(x-c) = r^2. $$

Intuition: lines and hyperplanes are linear equations (flat); a sphere is a quadratic one (curved), a genuinely different shape.

Shapes

$$ \underbrace{(x-c)^T}_{1\times n}\underbrace{(x-c)}_{n\times1} = \underbrace{r^2}_{1\times1}. $$

Intuition: squared distance is the same row-times-column shape as every dot product above, just applied to $x-c$ with itself; it's quadratic in $x$ because $x$ now appears twice.

Example

$$ c = \begin{pmatrix}0\\0\end{pmatrix}, \ r = 1 \;\Rightarrow\; x^2+y^2=1 \quad \text{(unit circle)}. \quad (1,0): \ 1^2+0^2=1. \ \checkmark $$

c r x ∥x−c∥ = r
The circle $\|x-c\|=r$: every point $x$ on the boundary sits at exactly distance $r$ from the center $c$.