miv_simulator.geometry.point_fit#

Procedures to fit 3d point clouds to an alpha shape

Functions

PCA(data[, correlation, sort])

Applies Principal Component Analysis to the data

points_plane_fit(points[, equation])

Computes the best fitting plane of the given points

rotvector3d(A, B)

ssc(v)

miv_simulator.geometry.point_fit.PCA(data, correlation=False, sort=True)[source]#

Applies Principal Component Analysis to the data

Parameters:
data: array
The array containing the data. The array must have NxM dimensions, where each
of the N rows represents a different individual record and each of the M columns
represents a different variable recorded for that individual record.

array([ [V11, … , V1m], …, [Vn1, … , Vnm]])

correlation(Optional)bool
Set the type of matrix to be computed (see Notes):

If True compute the correlation matrix. If False(Default) compute the covariance matrix.

sort(Optional)bool
Set the order that the eigenvalues/vectors will have

If True(Default) they will be sorted (from higher value to less). If False they won’t.

Returns
——-
eigenvalues: (1,M) array
The eigenvalues of the corresponding matrix.
eigenvector: (M,M) array
The eigenvectors of the corresponding matrix.

Notes

The correlation matrix is a better choice when there are different magnitudes representing the M variables. Use covariance matrix in other cases.

miv_simulator.geometry.point_fit.points_plane_fit(points, equation=False)[source]#

Computes the best fitting plane of the given points

Parameters:
points: array
The x,y,z coordinates corresponding to the points from which we want
to define the best fitting plane. Expected format:

array([ [x1,y1,z1], …, [xn,yn,zn]])

equation(Optional)bool
Set the oputput plane format:

If True return the a,b,c,d coefficients of the plane. If False(Default) return 1 Point and 1 Normal vector.

Returns
——-
a, b, c, dfloat
The coefficients solving the plane equation.
or
point, normal: array
The plane defined by 1 Point and 1 Normal vector. With format:
array([Px,Py,Pz]), array([Nx,Ny,Nz])