Vector Classes#

This class implements a vector, with the rotational and translation.

class Vector(origin, **kwargs)[source]#

Bases: Base

3D vector class with basic operations.

__init__(origin, **kwargs)[source]#
R(axis, theta: float) ndarray[source]#

Returns the rotation matrix for a proper rotation by angle theta around the axis (u_x, u_y, u_z), where the axis is a unit vector.

Parameters:
  • axis – tuple or list of length 3 (unit vector u_x, u_y, u_z)

  • theta – float, rotation angle in radians

Returns:

A 3x3 numpy array representing the rotation matrix.

RotX(theta)[source]#

Rotate around global x-axis.

RotY(theta)[source]#

Rotate around global y-axis.

RotZ(theta)[source]#

Rotate around global z-axis.

RotXAroundLocal(localpoint, theta)[source]#

Rotate around global x-axis at a local point.

RotYAroundLocal(localpoint, theta)[source]#

Rotate around global y-axis at a local point.

RotZAroundLocal(localpoint, theta)[source]#

Rotate around global z-axis at a local point.

TX(dx)[source]#

Translate the object along the x-axis.

TY(dy)[source]#

Translate the object along the y-axis.

TZ(dz)[source]#

Translate the object along the z-axis.