orthonormalize_vectors

compas.geometry.orthonormalize_vectors(vectors)[source]

Orthonormalize a set of vectors.

Parameters

vectors (sequence[[float, float, float] | compas.geometry.Vector]) – The set of vectors to othonormalize.

Returns

list[[float, float, float]] – An othonormal basis for the input vectors.

Notes

This creates a basis for the range (column space) of the matrix A.T, with A = vectors.

Orthonormalisation is according to the Gram-Schmidt process.

Examples

>>> orthonormalize_vectors([[1.0, 0.0, 0.0], [1.0, 1.0, 0.0], [0.0, 0.0, 1.0]])
[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]