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. Except explicit open source licence (indicated Creative Commons / free), the "Gram-Schmidt Orthonormalization" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "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.) and all data download, script, or API access for "Gram-Schmidt Orthonormalization" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Gram-Schmidt Orthonormalization" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Gram-Schmidt Orthonormalization on dCode.fr [online website], retrieved on 2024-12-02,