dot_vectors_xy

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

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

Parameters
  • u ([float, float] or [float, float, float] | compas.geometry.Vector) – XY(Z) coordinates of the first vector.

  • v ([float, float] or [float, float, float] | compas.geometry.Vector) – XY(Z) coordinates of the second vector.

Returns

float – The dot product of the XY components of the two vectors.

Examples

>>> dot_vectors_xy([1.0, 0], [2.0, 0])
2.0
>>> dot_vectors_xy([1.0, 0, 0], [2.0, 0, 0])
2.0
>>> dot_vectors_xy([1.0, 0, 1], [2.0, 0, 1])
2.0