swarmauri.core.vector_stores.IVectorRotate module

class swarmauri.core.vector_stores.IVectorRotate.IRotate[source]

Bases: ABC

Interface for rotating a vector.

abstract rotate(vector, angle, axis=None)[source]

Rotate the given vector by a specified angle around an axis (for 3D) or in a plane (for 2D).

For 2D vectors, the axis parameter can be omitted.

Parameters:
  • vector (List[float]) – The vector to rotate.

  • angle (float) – The angle of rotation in degrees.

  • axis (List[float], optional) – The axis of rotation (applicable in 3D).

Returns:

The rotated vector.

Return type:

List[float]