Engineering/Mathematics/Vector Spaces
Orthonormal Bases and Coordinates
Writing a vector in terms of a basis normally means solving a linear system. If the basis is orthonormal, every coordinate is a single inner product , and the system disappears.
- Advanced level
- Stream: orthogonality
- Reading time 14 min
- Ref KVS-ENG-MATH-0074
- Taxonomy
- Engineering / Mathematics
- Prerequisite
- Inner products, norms, bases
- Key result
- Coordinates and Orthonormal Bases (COB)
- Cost of one coordinate
- — one inner product, no solve
- Source of examples
- Gram-Schmidt output; columns of an orthogonal matrix
- Bonus identity
- Parseval:
Overview
A basis of a vector space guarantees that every vector has exactly one expression as a linear combination of . That is an existence-and-uniqueness statement; it says nothing about how hard the coefficients are to obtain. For a general basis of a subspace the coefficients come from solving a linear system whose coefficient matrix has the basis vectors as columns, which costs a full row reduction every time a new vector arrives.
An orthonormal basis removes that cost entirely. When the basis vectors are mutually orthogonal and each has norm , the inner product of a vector with a basis vector is the corresponding coordinate. No system is assembled and no reduction is performed; each coordinate is an independent dot product, and the coordinates can be computed in parallel with no data dependence between them.
Orthonormal bases are not rare or difficult to obtain. Any basis of any subspace of can be converted into one: the Gram-Schmidt procedure produces an orthogonal set with the same span, and dividing each output vector by its norm makes the set orthonormal without disturbing the span or the independence. Orthogonal and unitary matrices provide a second, equally common source — the columns of an orthogonal matrix are an orthonormal basis of by construction.
The consequences reach well beyond convenience. Coordinates relative to an orthonormal basis are norm-preserving, so lengths and angles computed in the new coordinates agree with those computed in the original ones. This is the reason orthonormal bases dominate signal processing, least-squares estimation, modal analysis and numerical eigenvalue work: they change the description of a problem without distorting its geometry, and the change is numerically benign because no ill-conditioned system is ever formed.
Definition
Orthonormal Basis
ONBA basis of a subspace of in which the vectors are pairwise orthogonal and each has unit norm. Equivalently, the two conditions below hold for all and .
- whenever — orthogonality.
- , equivalently — normalisation.
Orthogonality of a set of non-zero vectors already forces linear independence, so an orthonormal set that spans is automatically a basis; the spanning condition is the only one that needs separate checking.
Coordinates Relative to an Orthonormal Basis
COBGiven an orthonormal basis of and any , the coordinates of relative to are the scalars for . The defining property is that these scalars reconstruct the vector: .
Inner Product (convention used here)
IPFor , . The conjugate falls on the second argument, so the form is linear in the first slot and conjugate-linear in the second. Over real entries the conjugates vanish and this is the ordinary dot product.
Concepts
The coordinate theorem and its proof mechanism
Suppose is an orthonormal basis of and . Because is a basis, for a unique choice of scalars. The whole content of the theorem is the identification of those scalars. Take the inner product of both sides with : linearity in the first argument distributes the product over the sum, so . Every term with vanishes by orthogonality, and the surviving term is . Hence .
Why normalisation as well as orthogonality
If the basis is merely orthogonal, the same derivation gives , so the coordinate is . That is still cheap, but it carries a division and a stored norm for every basis vector. Normalising once, at construction time, absorbs that division permanently. In production code the choice is a genuine trade-off: an orthogonal basis with cached squared norms avoids square roots and can be held in exact rational arithmetic, whereas an orthonormal basis usually introduces irrational entries but makes every downstream formula division-free.
Manufacturing an orthonormal basis from any basis
Every finite-dimensional subspace of has an orthonormal basis, and the proof is constructive. Start with any basis of . The Gram-Schmidt procedure produces a set that is orthogonal, consists of non-zero vectors, and satisfies ; therefore is an orthogonal basis of . Scaling each vector of by the reciprocal of its norm changes neither the span nor the pairwise orthogonality, so the result is an orthonormal basis. The existence of an orthonormal basis is thus a corollary of the existence of any basis at all.
Orthogonal and unitary matrices as ready-made bases
A square matrix of size is orthogonal (unitary, over ) when . Reading that equation entry by entry says exactly that the columns of form an orthonormal set. Such a matrix is invertible, hence non-singular, hence its columns span ; an orthonormal set of vectors spanning is an orthonormal basis of . The converse holds too: assemble any orthonormal basis of as columns and the resulting matrix is unitary. Orthonormal bases of the full space and unitary matrices are two descriptions of one object.
Coordinate extraction as a matrix-vector product
Collect the orthonormal basis vectors as the columns of , an matrix with . Then the coordinate vector of is and the reconstruction is . This exposes the practical shape of the computation: coordinate extraction is one dense matrix-vector product, not a solve. When the operator is the orthogonal projector onto , which is why the same formula computes the best approximation of an arbitrary vector of by an element of .
Norm preservation and Parseval's identity
Because the basis is orthonormal, expanding in the basis kills every cross term and leaves . Energy in the vector equals energy in the coordinates. This is what makes an orthonormal change of description safe: a small perturbation of produces an equally small perturbation of the coordinates, and no direction is stretched or compressed. General bases do not have this property, and the ratio of stretch to compression is precisely the condition number of the basis matrix.
Procedure: coordinates relative to an orthonormal basis
Equations
Orthonormality condition
EQ-OBC-01The two defining conditions in one statement. The diagonal case is normalisation; the off-diagonal case is orthogonality.
Coordinates and orthonormal bases
EQ-OBC-02The central result. For any in the subspace spanned by the orthonormal basis, the coefficients of the unique expansion are the inner products with the basis vectors.
Coordinates from an orthogonal (unnormalised) basis
EQ-OBC-03The version that applies when the basis is orthogonal but not normalised. Each coefficient carries a division by the squared norm of its basis vector.
Matrix form of coordinate extraction and reconstruction
EQ-OBC-04With the orthonormal basis vectors as the columns of the matrix . When the matrix is unitary and ; when , is the orthogonal projector onto .
Parseval's identity
EQ-OBC-05Norm preservation under an orthonormal change of coordinates. It doubles as an inexpensive arithmetic check on a completed coordinate computation.
Normalisation of an orthogonal set
EQ-OBC-06The single step that converts an orthogonal basis into an orthonormal one. Scaling by a non-zero scalar preserves both the span of the set and every orthogonality relation within it.
Inner product convention
EQ-OBC-07Conjugation on the second argument. This convention is what allows the coordinate to appear as rather than ; the opposite convention swaps the arguments in every formula on this page.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Subspace | The subspace of in which the vector and the basis both live | subspace of C^m | |
| Orthonormal basis | The set of mutually orthogonal unit vectors spanning | set of p vectors in C^m | |
| Basis vector | The -th member of the orthonormal basis | vector in C^m with norm 1 | |
| Target vector | The vector whose coordinates relative to are wanted | vector in W | |
| Dimension | Number of basis vectors, equal to | 1 to m | |
| Ambient size | Number of entries in each vector | positive integer | |
| Coordinate | The -th coefficient in the expansion of over | complex scalar | |
| Basis matrix | The matrix whose columns are the orthonormal basis vectors | m x p matrix with Q*Q = I | |
| Norm | Length of , the non-negative square root of | non-negative real |
Worked Numerical Example
Problem statement
A triaxial accelerometer is bonded to a machine housing at an oblique angle, so its three sensing axes do not align with the global frame. The sensing axes are known unit vectors, mutually perpendicular by construction. Given a measured acceleration expressed in the global frame, resolve it into components along the three sensor axes and confirm the decomposition.
State the sensor axes
The three sensing directions, expressed in the global frame, are the columns of the mounting matrix. Each is scaled by so that its entries are integers over a common denominator.
Verify orthonormality before using the theorem
Every entry is real, so the inner product is the ordinary dot product. Norms: , and identically and . Cross terms: , , . All three conditions hold, so is an orthonormal set of three vectors in and therefore an orthonormal basis of .
State the measurement
The instantaneous acceleration reported in the global frame, in metres per second squared, is . Its norm is , so the total acceleration magnitude is .
Compute the coordinates as inner products
Each coordinate is a single dot product against a sensing axis. No linear system is assembled and the three computations are independent of one another.
Write the expansion
The coordinate theorem asserts that these three scalars reconstruct exactly, and that no other triple of scalars does.
Check the reconstruction entry by entry
Multiply out and clear the common factor of . The first entry is , the second , the third . The reconstruction agrees with the measurement.
Confirm with Parseval's identity
An independent check that does not repeat the reconstruction arithmetic: the sum of the squared coordinates must equal the squared norm of the original vector.
The sensor sees on axis 1, on axis 2 and on axis 3. The dominant response is on the third axis, which is the one most nearly aligned with the true acceleration direction. Because the mounting frame is orthonormal, the vector magnitude read in sensor coordinates is the same as in the global frame — the oblique mounting rotates the description without distorting the measured magnitude, so no calibration gain correction is needed.
Applications & Industry Use
Modal decomposition of a response
Mass-normalised mode shapes of a linear structure are orthonormal with respect to the mass-weighted inner product. A measured displacement field is resolved into modal participation factors by taking one inner product per mode, so a hundred-mode decomposition costs a hundred dot products rather than a hundred-dimensional solve. Truncating the expansion after the low modes gives a reduced-order model whose error is bounded by Parseval's identity.
Transform coefficients as inner products
The discrete Fourier, cosine and wavelet transforms are all coordinate computations relative to an orthonormal basis of . Each transform coefficient is the inner product of the signal with one basis function, and the inverse transform is the reconstruction sum. Parseval's identity is exactly the statement that total signal energy equals total spectral energy, which is the basis of every energy-domain filter specification.
Frame transformation for inertial sensors
Body-frame to navigation-frame conversion in an inertial measurement unit is a change between two orthonormal bases of , represented by a rotation matrix. Because the transformation is orthonormal, accelerometer and gyroscope magnitudes are invariant, allowing a direct residual check on the attitude estimate: a magnitude that drifts under rotation indicates calibration error rather than genuine motion.
Tangent-space and local shading frames
Normal mapping requires the tangent, bitangent and normal at each surface point to form an orthonormal frame. Lighting vectors are expressed in that frame by three dot products, and because the frame is orthonormal the inverse transformation is the transpose, which needs no matrix inversion at fragment-shader rates.
Principal component scores in spectroscopy
Principal component analysis of a spectral data set yields orthonormal loading vectors. The score of a new spectrum on each component is a single inner product with the corresponding loading, so classifying an unknown sample requires no re-fitting. Orthonormality of the loadings is also what makes the residual after components a clean measure of unexplained variance.
Orthonormal bases inside iterative solvers
Krylov subspace methods such as GMRES and Lanczos maintain an explicitly orthonormal basis of the growing search space, generated by Gram-Schmidt or Householder reflections. Keeping the basis orthonormal is what keeps the small projected problem well conditioned; loss of orthogonality in finite precision is the classic failure mechanism of these algorithms and drives the use of reorthogonalisation.
Design Considerations
Decide whether normalisation is worth the irrational entries
Normalising introduces a square root for every basis vector, which forces a symbolic computation out of exact rational arithmetic. If the goal is an exact symbolic answer, keep the basis orthogonal and divide by in the coefficient formula. If the goal is repeated numerical projection of many vectors, normalise once and reap the division-free formula thereafter.
Verify orthonormality before relying on the coordinate formula
The formula is only valid for a genuinely orthonormal basis. Applied to a near-orthonormal set it returns plausible-looking numbers that do not reconstruct the input. Check against the identity and report as a routine diagnostic before trusting any coordinate output.
Confirm that the target vector actually lies in the subspace
The reconstruction identity holds for . If the same formula still computes something useful — the orthogonal projection of onto , which is the closest point of to — but it will not reproduce . Deciding which of these two situations applies is the difference between an exact change of coordinates and a least-squares approximation.
Prefer a stable orthogonalisation to classical Gram-Schmidt
Classical Gram-Schmidt loses orthogonality rapidly when the input basis is ill conditioned; the computed can depart from orthonormality by a factor proportional to the square of the condition number. Modified Gram-Schmidt is markedly better, and Householder QR is backward stable. For any production orthonormalisation, use a library QR factorisation rather than hand-coding the classical recurrence.
Fix and document the inner product convention
Placing the conjugate on the first argument instead of the second swaps for its conjugate throughout. Real-valued test data will never reveal the discrepancy, so a convention mismatch between two modules can survive an entire test suite and then fail silently on the first complex input. State the convention in the interface documentation, not just the code.
Exploit parallelism in coordinate extraction
The inner products are mutually independent, unlike the sequential back-substitution of a triangular solve. Coordinate extraction against an orthonormal basis therefore vectorises and parallelises cleanly, and maps directly to a single BLAS Level 2 or Level 3 call. This structural advantage often matters more in practice than the operation-count saving.
Standards & Codes
Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.
| Reference | Title | Relevance to this topic |
|---|---|---|
ISO 80000-2 | Quantities and units — Part 2: Mathematics | Fixes the notation used here: for the inner product, for the norm, and the overline for complex conjugation, together with the italic and upright conventions for variables and operators. |
BLAS Level 1 / Level 2 | Basic Linear Algebra Subprograms | Coordinate extraction maps onto standard kernels: xDOT for a single inner product, xNRM2 for a numerically safe norm that avoids overflow, and xGEMV for the whole coordinate vector as one matrix-vector product. |
LAPACK xGEQRF / xORGQR | Linear Algebra PACKage QR factorisation routines | The reference implementation of numerically stable orthonormalisation. xGEQRF computes a Householder QR factorisation and xORGQR forms the explicit orthonormal , which is the recommended substitute for hand-coded Gram-Schmidt. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Defines the rounding behaviour that causes computed orthogonality to degrade. It also specifies the exceptional cases — overflow in forming for large-magnitude vectors — that scaled norm routines are designed to avoid. |
ISO 5725-2 | Accuracy (trueness and precision) of measurement methods and results | Relevant where an orthonormal frame is realised physically, as in a sensor mounting: the standard governs how the departure of the manufactured axes from exact orthonormality is quantified and reported. |
Material Selection
For a mathematical topic, "material" is the numeric representation: the scalar field, storage format and precision the computation is built from.
| Representation | Select when | Trade-off |
|---|---|---|
| Exact rational entries with an orthogonal (unnormalised) basis | Symbolic work where the coordinates must be exact and the basis comes from Gram-Schmidt applied to rational input. | Coordinates stay exact and no square roots appear, but every coefficient carries a division by a squared norm and the entries can grow large. |
| Exact algebraic entries with normalisation | Small hand or symbolic computations where an explicitly unit-length basis is required for presentation. | Formulas become division-free, but entries acquire surds such as and subsequent symbolic manipulation becomes markedly slower. |
| IEEE 754 binary64 with Householder QR | General numerical work: least squares, projections, iterative solvers, reduced-order modelling. | Orthogonality is preserved to near machine precision and the cost is predictable, but the basis is no longer exactly orthonormal and residual checks must carry a tolerance. |
| IEEE 754 binary32 on accelerators | Real-time graphics frames and embedded attitude solutions where throughput dominates and the frame is refreshed frequently. | Halves bandwidth but accumulates drift in an incrementally updated frame; periodic re-orthonormalisation becomes mandatory rather than optional. |
| Fixed-point representation with a scaled unit convention | Microcontroller attitude and sensor-fusion code with no floating-point unit. | Unit vectors map naturally onto a fixed fractional scale and dot products are exact before rounding, but intermediate accumulation must be widened to avoid overflow. |
| Implicit Householder representation of | Large with , where forming the explicit basis is wasteful. | Storage drops to the compact reflector form and application of or stays cheap, but individual basis vectors are no longer directly inspectable. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Operation count
One coordinate costs multiplications and additions. A full coordinate vector for a -dimensional subspace of therefore costs about real floating-point operations. The general-basis alternative — forming and solving the normal system, or a QR solve — is an order of magnitude more expensive and must be repeated for each new vector, whereas the orthonormal computation is a pure matrix-vector product.
Producing the basis by hand
Work through Gram-Schmidt one vector at a time and defer all normalisation to the very end. Subtracting projections of exact rational vectors keeps every intermediate rational; introducing square roots early forces surds through the remaining subtractions and multiplies the algebraic effort several times over. Normalise only when the orthogonal set is complete and verified.
Library behaviour
numpy.linalg.qr and scipy.linalg.qr return an orthonormal by Householder reflections; the reduced mode gives the economy factor appropriate for a subspace basis. SymPy exposes GramSchmidt(vectors, orthonormal=True) for exact work. MATLAB's orth derives an orthonormal basis for a column space from the singular value decomposition, which is more robust than QR when the input columns are close to dependent.Verifying a computed basis
Two checks are worth running. First, orthonormality: compute and require it to be a small multiple of the unit roundoff. Second, span: confirm that the original basis vectors are reproduced by , which catches a basis that is orthonormal but spans the wrong subspace — a failure mode that the first check alone cannot detect.
Maintaining orthonormality under incremental update
An orthonormal frame that is updated repeatedly, as in an attitude integrator or a Krylov iteration, drifts away from orthonormality at a rate driven by accumulated rounding. Two standard remedies exist: periodic re-orthonormalisation of the whole frame, or selective reorthogonalisation of each new vector against the existing set whenever the norm drops by more than a set factor during the projection step.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Applying the coordinate formula to a merely orthogonal basis | high | Skipping normalisation but still using , so each coefficient is wrong by the factor . | Either normalise the basis explicitly or use the divided form ; never mix the two. |
| Conjugating the wrong argument | high | Implementing with the conjugate on the first slot while the formula on the page assumes the second. | Test with a genuinely complex vector, not a real one. Assert conjugate symmetry against a known case. |
| Assuming the reconstruction holds for a vector outside the subspace | medium | Applying the expansion to an arbitrary when the basis spans only a proper subspace . | Compute the residual and test its norm. A non-zero residual means the result is a projection, not a decomposition. |
| Loss of orthogonality in classical Gram-Schmidt | high | Cancellation when subtracting projections from a nearly dependent input vector, which corrupts the computed basis in proportion to the square of the condition number. | Use modified Gram-Schmidt with reorthogonalisation, or Householder QR from a library. Monitor after construction. |
| Norm overflow or underflow | medium | Computing as the square root of a naive sum of squares, which overflows for entries near the format maximum and underflows to zero for very small entries. | Use a scaled norm routine (xNRM2, numpy.linalg.norm) that factors out the largest magnitude before squaring. |
| Dividing by a zero norm | medium | Attempting to normalise a Gram-Schmidt output vector that came out zero because the input set was linearly dependent. | Test each candidate against a tolerance before dividing. A zero output signals a dependent input vector, which should be discarded rather than normalised. |
| Confusing an orthonormal set with an orthonormal basis | medium | Treating a set of orthonormal vectors as though it spans , so the expansion silently discards part of the vector. | Count the vectors against the known dimension of the subspace, and confirm spanning independently rather than inferring it from orthonormality. |
| Assuming coordinates transfer between different orthonormal bases | low | Reusing a coordinate vector computed against one orthonormal basis in a formula written for another. | Label every coordinate vector with the basis it refers to, and convert between bases explicitly through the change-of-basis matrix . |
FAQs
Why is an orthonormal basis so much better than an ordinary basis?
Because it converts coordinate extraction from a linear solve into a set of independent inner products. With a general basis, finding the coefficients of requires row-reducing a system whose columns are the basis vectors, and the work must be repeated for every new . With an orthonormal basis each coefficient is one dot product, computable independently of the others and immune to the conditioning of the basis matrix.
Does every subspace have an orthonormal basis?
Yes, and constructively so. Take any basis of the subspace, apply the Gram-Schmidt procedure to obtain an orthogonal set with the same span, then divide each vector by its norm. Neither step changes the span and neither destroys linear independence, so the result is an orthonormal basis of the same subspace.
What happens if I apply the coordinate formula to a vector that is not in the subspace?
You get the orthogonal projection of that vector onto the subspace — the unique element of closest to in the norm. That is a useful answer, and it is the foundation of least-squares approximation, but it is not a decomposition of . Check the residual to tell the two cases apart.
How are orthonormal bases related to orthogonal and unitary matrices?
They are the same objects seen from different angles. Assembling an orthonormal basis of into the columns of a square matrix produces a unitary matrix, since is exactly the statement that the columns are orthonormal. Conversely the columns of any unitary matrix are an orthonormal basis of , because they are orthonormal, hence independent, and there are of them.
Is the orthonormal basis produced by Gram-Schmidt unique?
No. It depends on the ordering of the input vectors, and each output vector could be multiplied by any scalar of modulus one without violating orthonormality. What is unique, given a fixed input ordering and a positivity convention on the leading coefficients, is the sequence of nested subspaces the procedure builds — which is why the QR factorisation is unique under a sign convention on the diagonal of .
Why does Parseval's identity hold only for orthonormal bases?
Expanding over a basis produces diagonal terms plus cross terms . Orthogonality kills the cross terms and normalisation reduces each diagonal factor to one. Drop either condition and the identity acquires correction terms; drop orthogonality and the correction terms do not even have a fixed sign.
Should I normalise before or after Gram-Schmidt?
After, if you are working by hand or symbolically. Normalising early introduces square roots into every subsequent projection subtraction and multiplies the algebraic labour. Numerically the distinction is less important, but modified Gram-Schmidt implementations normalise each vector as it is completed because the unit-norm intermediate keeps the projection coefficients well scaled.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section PD, Subsection OBC. Licensed under the GNU Free Documentation License v1.2.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
- Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013. Chapter 5, orthogonalisation and QR.
- Anderson, E. et al. LAPACK Users' Guide, 3rd edition. Society for Industrial and Applied Mathematics, 1999.
- IEEE 754-2019, IEEE Standard for Floating-Point Arithmetic. Institute of Electrical and Electronics Engineers.
AI Suggested Questions
- Show me a case where classical Gram-Schmidt loses orthogonality badly but modified Gram-Schmidt does not, with the measured for each.
- How does the coordinate formula change if the inner product is weighted by a positive definite matrix, as in mass-normalised structural modes?
- Derive the orthogonal projector onto a subspace from its orthonormal basis, and explain why the projector does not depend on which orthonormal basis is chosen.
- Compare the operation count of extracting coordinates against an orthonormal basis with solving the corresponding least-squares problem by QR.
- Why is the discrete Fourier basis orthonormal after scaling by , and what does Parseval's identity become in that setting?
- Given a physically manufactured sensor triad whose axes are only approximately orthogonal, how should I correct the measured coordinates?
Related Calculators
Convert any independent set into an orthogonal or orthonormal basis, with exact rational or floating-point output.
Orthonormal Coordinate CalculatorCompute the coordinates of a vector relative to a supplied orthonormal basis and verify the reconstruction and Parseval's identity.
Orthogonal Projection CalculatorProject a vector onto the span of a given set and report the projection, the residual and the residual norm.
