is_parallel_vector_vector

compas.geometry.is_parallel_vector_vector(u, v, tol=None)[source]

Determine if two vectors are parallel.

Parameters:
u[float, float, float] | Vector

Vector 1.

v[float, float, float] | Vector

Vector 2.

tolfloat, optional

Tolerance for comparing the length of the cross product of the two vectors to zero. Default is TOL.absolute.

Returns:
bool

True if the vectors are parallel. False otherwise.

See also

is_parallel_line_line
is_parallel_plane_plane

Notes

The length of the cross product of two vectors is equal to the area of the parallelogram formed by the two vectors. If the vectors are parallel, the area of the parallelogram is zero.

Therefore, this predicate is based on the comparison of the length of the cross product of the two vectors to zero, and not on the comparison to zero of the actual angle between the two vectors.