ectoolkits.utils.math module#
- 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