AGX Dynamics  2.35.0.1
agxCollide::RegressionPlane Class Reference

A plane created from points using least squares minimization. More...

#include <RegressionPlane.h>

Public Types

enum  DimensionType { EMPTY , POINT , LINE , PLANE }
 Dimension type of the sub-space resulted by the regression. More...
 

Public Member Functions

 RegressionPlane (const agx::Vec3 &linearCoefficients, const agx::SPDMatrix3x3 &quadraticCoefficients, const agx::Vec3 &averagePoint, const size_t numPoints)
 Creates a RegressionPlane from the coefficients precomputed from a number of 3D points. More...
 
 RegressionPlane (const agx::Vec3Vector &points)
 
 RegressionPlane (const agxData::LocalVector< agx::Vec3 > &points)
 Creates a RegressionPlane from a number of 3D-points. More...
 
agx::Vec3 getAveragePoint () const
 Gets the average point of the plane. More...
 
DimensionType getDimensionType () const
 Gets the dimension type of the plane. More...
 
agx::Vec3 getLineDirection () const
 Gets the average point of the plane. More...
 
agx::Real getMaxDeterminant () const
 Returns the maximum determinant from the least squares minimization. More...
 
agx::Plane getPlane () const
 Gets the average point of the plane. More...
 
bool isPlane () const
 Is the regression plane a plane (and not empty, point or line)? More...
 

Detailed Description

A plane created from points using least squares minimization.

If no valid plane can be created, regression to a line or point is attempted.

Definition at line 39 of file RegressionPlane.h.

Member Enumeration Documentation

◆ DimensionType

Dimension type of the sub-space resulted by the regression.

Enumerator
EMPTY 
POINT 
LINE 
PLANE 

Definition at line 44 of file RegressionPlane.h.

Constructor & Destructor Documentation

◆ RegressionPlane() [1/3]

agxCollide::RegressionPlane::RegressionPlane ( const agxData::LocalVector< agx::Vec3 > &  points)

Creates a RegressionPlane from a number of 3D-points.

If there a no points in the Vector, the RegressionPlane's DimensionType will be EMPTY. If all points are (roughly) identical, the RegressionPlane's DimensionType will be POINT. If all points lie (roughly) in a line with finite positive length, the RegressionPlane's DimensionType will be LINE. In all other cases, a plane can be constructed from the points, and the RegressionPlane's DimensionType will be PLANE.

Parameters
pointsA pointer to a vector of points. The RegressionPlane does not take over ownership of or store references to the pointer.

◆ RegressionPlane() [2/3]

agxCollide::RegressionPlane::RegressionPlane ( const agx::Vec3Vector &  points)

◆ RegressionPlane() [3/3]

agxCollide::RegressionPlane::RegressionPlane ( const agx::Vec3 &  linearCoefficients,
const agx::SPDMatrix3x3 &  quadraticCoefficients,
const agx::Vec3 &  averagePoint,
const size_t  numPoints 
)

Creates a RegressionPlane from the coefficients precomputed from a number of 3D points.

Parameters
linearCoefficientssum of derivations of all points from averagePoint (x, y, z)
quadraticCoefficientssum of component wise product of derivation of each point from averagePoint (xx, xy, xz, yx, yy, yz, zx, zy, zz)
averagePointMean value of all points.
numPointsThe number of points.

Member Function Documentation

◆ getAveragePoint()

agx::Vec3 agxCollide::RegressionPlane::getAveragePoint ( ) const

Gets the average point of the plane.

Note
Only valid if dimension type is POINT, LINE or PLANE.

Definition at line 142 of file RegressionPlane.h.

References agxAssert, and EMPTY.

◆ getDimensionType()

RegressionPlane::DimensionType agxCollide::RegressionPlane::getDimensionType ( ) const

Gets the dimension type of the plane.

Definition at line 131 of file RegressionPlane.h.

◆ getLineDirection()

agx::Vec3 agxCollide::RegressionPlane::getLineDirection ( ) const

Gets the average point of the plane.

Note
Only valid if dimension type is LINE or PLANE.

Definition at line 149 of file RegressionPlane.h.

References agxAssert, and POINT.

◆ getMaxDeterminant()

agx::Real agxCollide::RegressionPlane::getMaxDeterminant ( ) const

Returns the maximum determinant from the least squares minimization.

Definition at line 136 of file RegressionPlane.h.

◆ getPlane()

agx::Plane agxCollide::RegressionPlane::getPlane ( ) const

Gets the average point of the plane.

Note
Only valid if dimension type is PLANE.

Definition at line 156 of file RegressionPlane.h.

References agxAssert, and PLANE.

◆ isPlane()

bool agxCollide::RegressionPlane::isPlane ( ) const

Is the regression plane a plane (and not empty, point or line)?

Definition at line 163 of file RegressionPlane.h.

References PLANE.


The documentation for this class was generated from the following file: