0% found this document useful (0 votes)
7 views1 page

In (1) : in (2) :: Def For For If Return

The document outlines Experiment No. 7 conducted by Nayan Supe on April 21, 2025, aimed at orthonormalizing a set of vectors using the Gram-Schmidt orthogonalization process. The code provided successfully computes the orthonormal basis for the given vectors. The conclusion confirms the successful completion of the orthonormalization process.

Uploaded by

nayansupe23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

In (1) : in (2) :: Def For For If Return

The document outlines Experiment No. 7 conducted by Nayan Supe on April 21, 2025, aimed at orthonormalizing a set of vectors using the Gram-Schmidt orthogonalization process. The code provided successfully computes the orthonormal basis for the given vectors. The conclusion confirms the successful completion of the orthonormalization process.

Uploaded by

nayansupe23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Experiment No : 7

Name : Nayan supe

Date : 21/04/2025

Aim : To ortonormalise the given set of vectors by gram schmidt orthogonalisation process

In [1]: V = [vector(RDF,[1,1,1]),vector(RDF,[1,3,1]),vector(RDF,[0,6,1])]

In [2]: def gram_schmidt (vectors) :


orthonormal_set = []
for v in vectors:
for u in orthonormal_set:
v -= v.dot_product(u) * u
if v.norm() != 0:
orthonormal_set.append(v/v.norm())
return orthonormal_set

In [3]: orthonormal_vectors = gram_schmidt(V)

In [4]: print("Orthonormal basis:")


for vec in orthonormal_vectors:
print(vec)

Orthonormal basis:
(0.5773502691896258, 0.5773502691896258, 0.5773502691896258)
(-0.4082482904638632, 0.8164965809277258, -0.4082482904638632)
(-0.7071067811865481, 6.2803698347351e-16, 0.7071067811865468)

Conclusion : successfully ortonormalise the given set of vectors by gram schmidt orthogonalisation
process.

You might also like