mt.geo3d.moments
Raw moments up to 2nd order of 3D points.
Classes
Moments3d
: Raw moments up to 2nd order of points living in 3D, implemnted in GLM.
- class mt.geo3d.moments.Moments3d(m0: float, m1: ndarray | vec3, m2: ndarray | mat3x3)
Raw moments up to 2nd order of points living in 3D, implemnted in GLM.
Overloaded operators are negation, multiplication with a scalar and true division with a scalar.
- Parameters:
m0 (float) – 0th-order raw moment
m1 (glm.vec3) – 1st-order raw moment
m2 (glm.mat3 or numpy.ndarray) – 2nd-order raw moment. If the input is numpy.ndarray, a row-major matrix is expected. Otherwise, a column-major matrix is expected.
- m0
0th-order raw moment
- Type:
float
- m1_glm
1st-order raw moment
- Type:
glm.vec3
- m1
the numpy view of m1_glm
- Type:
numpy.ndarray
- m2_glm
2nd-order column-major raw moment
- Type:
glm.mat3
- m2
the numpy view of m2_glm
- Type:
numpy.ndarray
- mean_glm
the mean of points
- Type:
glm.vec3
- mean
the numpy view of mean_glm
- Type:
numpy.ndarray
- cov_glm
the covariance matrix of points
- Type:
glm.mat3
- cov
the numpy view of cov_glm
- Type:
numpy.ndarray
Examples
>>> import numpy as np >>> from mt.geo3d.moments import Moments3d >>> gm.Moments3d(10, np.array([2,3,1]), np.array([[1,2,0],[3,4,0],[0,0,1]])) Moments3d(m0=10, mean=vec3( 0.2, 0.3, 0.1 ), cov=mat3x3(( 0.06, 0.24, -0.02 ), ( 0.14, 0.31, -0.03 ), ( -0.02, -0.03, 0.09 )))
See also
Moments
base class
Inheritance
digraph inheritancee65d63cf44 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "GeometricObject" [URL="../mt.geo/mt.geo.object.html#mt.geo.object.GeometricObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A geometric object which lives in a d-dimensional Euclidean space."]; "Moments" [URL="../mt.geond/mt.geond.moments.html#mt.geond.moments.Moments",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Raw moments up to 2nd order of points living in the same Euclidean space."]; "GeometricObject" -> "Moments" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Moments3d" [URL="#mt.geo3d.moments.Moments3d",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Raw moments up to 2nd order of points living in 3D, implemnted in GLM."]; "ThreeD" -> "Moments3d" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Moments" -> "Moments3d" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ThreeD" [URL="../mt.geo/mt.geo.object.html#mt.geo.object.ThreeD",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin to assert that the geometric object lives in 3D Euclidean space."]; }- __init__(m0: float, m1: ndarray | vec3, m2: ndarray | mat3x3)
- __repr__()
Return repr(self).
- property cov
Returns the row-major covariance matrix as a numpy array.
- property cov_glm
Returns the column-major covariance matrix as a mat3.
- property m1
1st-order moment
- property m2
2nd-order moment
- property mean
Returns the mean vector.
- property mean_glm
Returns the mean vector as a vec3.