Householder reflection sending a vector to a coordinate axis

ID: householder-reflection-sending-a-vector-to-a-coordinate-axis

For a nonzero real vector , choose with and put . When , the Householder reflection
satisfies : every component except the first becomes zero. Here is the first Cartesian basis vector. The calculation is short:
If , the vector is already at the selected target, so the identity matrix suffices.
In floating-point arithmetic, a customary choice is
Then , avoiding subtraction of nearly equal positive quantities in the first component. Either sign can be valid in exact arithmetic; the numerical choice protects the construction from catastrophic cancellation. [ref]
For , this choice gives and . Dividing by its Euclidean norm gives , exactly the normal in the geometric example.

New to topics? Read the docs here!