CoordinateSystem#

class atompy.CoordinateSystem(vec1, vec2, vec3=None)[source]#

Create a coordinate systems defined by vec1, vec2 (and vec3).

The new coordinate system will be defined by the following unit vectors:

  • z will exactly align with vec1.

  • y is a unit vector along vec1.cross(vec2)

  • x is a unit vector along y.cross(vec1)

The coordinate system is right-handed and orthogonal.

If vec3 is provided, the behaviour changes (see below).

Parameters:
vec1, vec2Vector

The collection of vectors defining the coordinate systems.

Both collections need to have the same length.

vec3Vector, optional

If three collections of vectors are provided, the coordinate systems will simply use the normalized vec1, vec2, vec3 as x, y, z.

Methods

keep_where(mask)

Keep every CoordinateSystem i where mask[i] == True.

project_vector(vec)

Project vector into coordinate system

remove_where(mask)

Remove every CoordinateSystem i where mask[i] == True