MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / orthonormalize

Function orthonormalize

src/geode/geometry/intersection.cpp:50–61  ·  view source on GitHub ↗

Gram-Schmidt orthonormalization to generate orthonormal vectors from the linearly independent inputs. The function returns the smallest length of the unnormalized vectors computed during the process. If this value is nearly zero, it is possible that the inputs are linearly dependent (within numerical round-off errors).

Source from the content-addressed store, hash-verified

48 // this value is nearly zero, it is possible that the inputs are linearly
49 // dependent (within numerical round-off errors).
50 void orthonormalize( Basis3D& basis )
51 {
52 for( const auto i : geode::LRange{ 3 } )
53 {
54 for( const auto j : geode::LRange{ i } )
55 {
56 const auto dot_ij = basis[i].dot( basis[j] );
57 basis[i] -= basis[j] * dot_ij;
58 }
59 basis[i] = basis[i].normalize();
60 }
61 }
62
63 // Compute a right-handed orthonormal basis for the orthogonal complement
64 // of the input vectors. The function returns the smallest length of the

Callers 1

compute_orthogonal_basisFunction · 0.85

Calls 2

dotMethod · 0.80
normalizeMethod · 0.80

Tested by

no test coverage detected