coords.Coords.dimensions#
- Coords.dimensions(tol=1e-05)#
Return the dimensionality of the Coords cloud.
The dimensionality is the number of principal sizes of the point collection that are larger than some tolerance value. This allows to easily test if points are collinear or coplanar.
Parameters#
- tol: float
The threshold value to consider a dimension small.
Returns#
- int (0..3)
The number of principal direction in which the dimension is smaller than tol. This identifies the overall shape of the Coords object: 0=point, 1=linear, 2=planar, 3=3D.
Examples#
>>> C = Coords([[0.,0.,0.],[0.,0.,0.],[0.,0.,0.]]) >>> C.dimensions() 0 >>> C = Coords([[0.,0.,0.],[1.,0.,0.],[2.,0.,0.]]) >>> C.dimensions() 1 >>> C = Coords([[0.,0.,0.],[1.,0.,0.],[0.,1.,0.]]) >>> C.dimensions() 2 >>> C = Coords([[0.,0.,0.],[1.,0.,0.],[0.,1.,0.],[0.,0.,1.]]) >>> C.dimensions() 3