Geometric Transformations#

All physical objects in PyMagba, including magnets and sensors, share a common interface for positioning and orienting them in 3D space.

Note

The following properties and methods are available on all magnet and sensor types. They are documented here for reference.

property position: ArrayLike3

Position of the object [x, y, z] in meters.

property orientation: scipy.spatial.transform.Rotation

Orientation as a scipy.spatial.transform.Rotation object.

translate(translation)

Translate the object by a displacement vector.

Parameters:

translation (ArrayLike3) – Displacement [dx, dy, dz] in meters.

rotate(rot)

Rotate the object about its own origin.

Parameters:

rot (Rotation | ArrayLike4) – Rotation to apply. Can be a scipy.spatial.transform.Rotation object or a unit quaternion as a list.

rotate_anchor(rot, anchor)

Rotate the object about an arbitrary anchor point.

Parameters:
  • rot (Rotation | ArrayLike4) – Rotation to apply.

  • anchor (ArrayLike3) – Anchor point [x, y, z] in meters about which to rotate.