Vector projection and rejection

Decompose a vector into projection and rejection and calculate the angle between vectors.

The example value has been entered. Check it immediately or change the value.

Input is processed in the browser. Refreshing returns a sample value.

Result

Instructions and example

projᵦ(a)=(a·b)/(b·b) b

The default projection is (2, 0, 2) and rejection is (1, 4, −1).

Use 1–10 components of equal dimensions; zero vectors are rejected.

Frequently asked questions

Can a zero vector be a projection target?

The target dot product is a divisor, so a zero target vector is rejected.

What does projection plus rejection recover?

Their sum recovers the original vector. The rejection dot target is 0 apart from rounding error.

Calculation criteria and reference materials

Verification of calculation criteria: · Calculation·verification principles · Report errors