ectoolkits.utils.math module#

ectoolkits.utils.math.birch_murnaghan_equation(V, V0, E0, B0, B0_prime)[source]#
ectoolkits.utils.math.fit_line_vec(xyz)[source]#

Fit the direction vector for a group of sampling points. Use PCA algorithm find the direction vector for a group of points. The PCA method reference: https://math.stackexchange.com/questions/1611308/best-fit-line-with-3d-points#:~:text=In%20three%20dimensions%20you%20can%20similarly%20fit%20a,and%20that%20involves%20what%20are%20called%20principal%20components.

Parameters:

xyz (numpy.ndarray) – Your group of points

ectoolkits.utils.math.fit_plane_normal(xyz)[source]#

Three dimensional plane fitting for a group of points

Parameters:

xyz (numpy.ndarray) – Your group of points, i.e., atoms in non-orthogonal cells forming a plane

Returns:

Normalized plane’s normal vector. z>0.

Return type:

numpy.ndarray

ectoolkits.utils.math.get_norm_vector(a, b)[source]#

obtain normal vector of a plane contain vectors a and b

a (_type_):

_description_

b (_type_):

_description_

_type_:

_description_

_notes_

_examples_

ectoolkits.utils.math.get_plane_distance(a, b)[source]#
ectoolkits.utils.math.get_plane_eq(a, b, c=array([0, 0, 1]))[source]#

obtain plane equation

a (_type_):

_description_

b (_type_):

_description_

c (_type_, optional):

_description_. Defaults to np.array([0, 0, 1]).

_type_:

_description_

_notes_

_examples_