Tool to calculate orthonormal bases of the subspace generated by vectors using the Gram-Schmidt algorithm (orthonormalization in 2D Plan, 3D or 4D Space) in formal calculation
Gram-Schmidt Orthonormalization - dCode
Tag(s) : Matrix
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The orthonormalization algorithm proposed by Gram-Schmidt makes it possible to define the existence of orthonormal bases in a space and construct them (from any base).
From a set of vectors $ \vec{v_i} $ and its corresponding orthonormal basis, composed of the vectors $ \vec{e_i} $, then the Gram-Schmidt algorithm consists in calculating the orthogonal vectors $ \vec{u_i} $ which will allow to obtain the orthonormal vectors $ \vec{e_i} $ whose components are the following (the operator . is the scalar product on the vector space)
$$ \vec{u_1} = \vec{v_1} \ , \quad \vec{e_1} = \frac{ \vec{u_1} } { \| \vec{u_1} \| } $$
$$ \vec{u_2} = \vec{v_2} - \frac{ \vec{u_1} . \vec{v_2} }{ \vec{u_1} . \vec{u_1} } \vec{u_1} \ , \quad \vec{e_2} = \frac{ \vec{u_2} } { \| \vec{u_2} \| } $$
$$ \vec{u_3} = \vec{v_3} - \frac{ \vec{u_1} . \vec{v_3} }{ \vec{u_1} . \vec{u_1} } \vec{u_1} - \frac{ \vec{u_2} . \vec{v_3} }{ \vec{u_2} . \vec{u_2} } \vec{u_2} \ , \quad \vec{e_3} = \frac{ \vec{u_3} } { \| \vec{u_3} \| } $$
$$ \vec{u_k} = \vec{v_k} - \sum_{j=1}^{k-1} { \frac{ \vec{u_j} . \vec{v_k} }{ \vec{u_j} . \vec{u_j} } \vec{u_j} } \ , \quad \vec{e_k} = \frac{ \vec{u_k} } { \| \vec{u_k} \| } $$
Example: Vectors $ \vec{v_1} = (1,2) $ and $ \vec{v_2} = (1,0) $ from $ \mathbb{R}^2 $ (2D plane) have for orthonormal basis $ \vec{e_1} = \left( \frac{1}{\sqrt{5}}, \frac{2}{\sqrt{5}} \right) $ and $ \vec{e_2} = \left( \frac{2}{\sqrt{5}}, \frac{-1}{\sqrt{5}} \right) $
Working with an orthonormal basis has many advantages. First of all, it makes it possible to simplify the calculations, because the coordinates of the vectors in this base are independent of each other. Moreover, it allows each vector in space to be represented in a unique way, which can be useful in many contexts.
dCode retains ownership of the "Gram-Schmidt Orthonormalization" source code. Any algorithm for the "Gram-Schmidt Orthonormalization" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Gram-Schmidt Orthonormalization" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Gram-Schmidt Orthonormalization" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Gram-Schmidt Orthonormalization" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Gram-Schmidt Orthonormalization on dCode.fr [online website], retrieved on 2025-04-15,