cross_vectors_xy

compas.geometry.cross_vectors_xy(u, v)[source]

Compute the cross product of two vectors, assuming they lie in the XY-plane.

Parameters
  • u (sequence of float) – XY(Z) coordinates of the first vector.

  • v (sequence of float) – XY(Z) coordinates of the second vector.

Returns

list – The cross product of the two vectors. This vector will be perpendicular to the XY plane.

Examples

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