Vector Projection

Vectors

Let's Do Math!

Intro: We return $\operatorname{proj}_{\vec{b}}\vec{a}$ and the orthogonal component $\vec{a}_\perp=\vec{a}-\operatorname{proj}_{\vec{b}}\vec{a}$, with exact fractions and a decimal check.

Worked example

FAQs

Zero vector b?

Projection is undefined when $\vec{b}=\vec{0}$ because the formula divides by $\lVert \vec{b} \rVert^{2}$.

Relation to angle?

The scalar projection (component of a along b) is $\|\vec{a}\|\cos\theta = \dfrac{\vec{a}\cdot\vec{b}}{\|\vec{b}\|}$. The vector projection scales the unit vector in the direction of $\vec{b}$: $\operatorname{proj}_{\vec{b}}\vec{a} = \dfrac{\vec{a}\cdot\vec{b}}{\|\vec{b}\|^2}\,\vec{b}$.

Any dimension?

Yes—works for any $n$. Enter matching-length vectors; we compute dot products and norms accordingly.

Why choose MathGPT?

How this calculator works

Related