homogenize_vectors

compas.geometry.homogenize_vectors(vectors, w=1.0)[source]

Homogenise a list of vectors.

Parameters
  • vectors (sequence[[float, float, float] | compas.geometry.Vector]) – A list of vectors.

  • w (float, optional) – Homogenisation parameter.

Returns

list[[float, float, float]] – Homogenised vectors.

Notes

Vectors described by XYZ components are homogenised by appending a homogenisation parameter to the components, and by dividing each component by that parameter. Homogenisatioon of vectors is often used in relation to transformations.

Examples

>>> vectors = [[1.0, 0.0, 0.0]]
>>> homogenize_vectors(vectors)
[[1.0, 0.0, 0.0, 1.0]]