Transformations (qcip_tools.transformations)

API documentation

Transformation (matrices) manipulation.

Constructed on top of transforms3d for the most part.

class qcip_tools.transformations.ImmutableRotatable
rotate_around_axis(axis, angle, is_normalized=False, in_degree=False)

Create a axis-angle rotation matrix

Parameters:
  • axis (numpy.ndarray) – axis

  • angle (float) – rotation angle (in degree)

  • is_normalized (bool) – is the axis already normalized?

  • in_degree (bool) – is the angle in degree ?

Return type:

ImmutableRotatable

rotate_euler(psi, theta, chi, axes='sxyz', in_degree=False)

Rotate via Euler angle

Parameters:
  • psi (float) – first rotation angle

  • theta (float) – second rotation angle

  • chi (float) – third rotation angle

  • axes (str) – axes

  • in_degree (bool) – is the angle in degree ?

Return type:

ImmutableRotatable

class qcip_tools.transformations.ImmutableScalable
scale(x, y, z)

Create a translation matrix

Parameters:
  • x (float) – scale x

  • y – scale y

  • y – float

  • z (float) – scale z

Return type:

ImmutableScalable

scale_uniform(factor)

Scale by a given factor

Parameters:

factor (float) – scale x

Return type:

ImmutableScalable

class qcip_tools.transformations.ImmutableTransformable

Transformation for non-mutable objects

class qcip_tools.transformations.ImmutableTranslatable

Translatable objects

translate(x, y, z)

Translate object

Parameters:
  • x (float) – translation x

  • y – translation y

  • y – float

  • z (float) – translation z:

Return type:

ImmutableTranslatable

class qcip_tools.transformations.MutableRotatable
rotate_around_axis_self(axis, angle, is_normalized=False, in_degree=False)

Create a axis-angle rotation matrix

Parameters:
  • axis (numpy.ndarray) – axis

  • angle (float) – rotation angle (in degree)

  • is_normalized (bool) – is the axis already normalized?

  • in_degree (bool) – is the angle in degree ?

rotate_euler_self(psi, theta, chi, axes='sxyz', in_degree=False)

Rotate via Euler angle

Parameters:
  • psi (float) – first rotation angle

  • theta (float) – second rotation angle

  • chi (float) – third rotation angle

  • axes (str) – axes

  • in_degree (bool) – is the angle in degree ?

class qcip_tools.transformations.MutableScalable
scale_self(x, y, z)

Create a translation matrix

Parameters:
  • x (float) – scale x

  • y – scale y

  • y – float

  • z (float) – scale z

scale_uniform_self(factor)

Scale by a given factor

Parameters:

factor (float) – scale x

class qcip_tools.transformations.MutableTransformable

Transformation for mutable objects

class qcip_tools.transformations.MutableTranslatable

Translatable objects

translate_self(x, y, z)

Translate object

Parameters:
  • x (float) – translation x

  • y – translation y

  • y – float

  • z (float) – translation z:

class qcip_tools.transformations.TransformationMatrix

4x4 matrix to represent a transformation

static identity()

Create identity 4x4 matrix

Return type:

numpy.ndarray

static rotate_around_axis(axis, angle, is_normalized=False, in_degree=False)

Create a axis-angle rotation matrix

Parameters:
  • axis (numpy.ndarray) – axis

  • angle (float) – rotation angle (in degree)

  • is_normalized (bool) – is the axis already normalized?

  • in_degree (bool) – is the angle in degree ?

Return type:

numpy.ndarray

static rotate_euler(psi, theta, chi, axes='sxyz', in_degree=False)

Rotate via Euler angle

Parameters:
  • psi (float) – first rotation angle

  • theta (float) – second rotation angle

  • chi (float) – third rotation angle

  • axes (str) – axes

  • in_degree (bool) – is the angle in degree ?

Return type:

numpy.ndarray

static scale(x, y, z)

Create a translation matrix

Parameters:
  • x (float) – scale x

  • y – scale y

  • y – float

  • z (float) – scale z

Return type:

numpy.ndarray

static scale_uniform(factor)

Scale by a given factor

Parameters:

factor (float) – scale x

Return type:

numpy.ndarray

static translate(x, y, z)

Create a translation matrix

Parameters:
  • x (float) – translation x

  • y – translation y

  • y – float

  • z (float) – translation z:

Return type:

numpy.ndarray