CoordinateSystem#

class atompy.CoordinateSystem(vector_1, vector_2, vector_3=None)[source]#

Class representing a single coordinate system.

Tip

If you want to store an array of coordinate systems, consider CoordinateSystemArray.

Parameters:
vector_1VectorLike

First vector \(\vec{v}_1\) defining the coordinate system.

vector_2VectorLike

Second vector \(\vec{v}_2\) defining the coordinate system. Should not be parallel to vector_1.

vector_3VectorLike or None, default None

Optional third vector. If three vectors are provided, use them as the new base vectors (after normalization).

Attributes:
x_axis, y_axis, z_axisVector

x, y, z basis vectors of the coordinate system.

Notes

The three basis vectors \(\hat{x}, \hat{y}, \hat{z}\) will be unit vectors along the directions given by

\[\begin{split}\vec{z} &= \vec{v_1} \\ \vec{y} &= \vec{v_z} \times \vec{v_2} \\ \vec{x} &= \vec{v_y} \times \vec{z}\end{split}\]

If three vectors are provided, the directions will be given by

\[\begin{split}\vec{x} &= \vec{v_1} \\ \vec{y} &= \vec{v_2} \\ \vec{z} &= \vec{v_3} \\\end{split}\]

Methods

project_vector(vector)

Project vector on the coordinate system.