Geogram  Version 1.9.1
A programming library of geometric algorithms
GEO::PrincipalAxes3d Class Reference

#include <geogram/points/principal_axes.h>

Public Member Functions

 PrincipalAxes3d ()
 PrincipalAxes3d constructor.
 
void begin ()
 Begins a principal axes estimation.
 
void end ()
 Ends a principal axes estimation.
 
void add_point (const vec3 &p, double weight=1.0)
 Adds a point to the current principal axes estimation. More...
 
vec3 center () const
 Gets the center. More...
 
const vec3axis (index_t i) const
 Gets one of the axes. More...
 
double eigen_value (index_t i) const
 Gets one of the eigenvalues. More...
 
vec3 normal () const
 Gets the estimated normal to the point cloud. More...
 

Detailed Description

PrincipalAxes3d enables the center and inertia axes of a cloud of 3d points to be computed.

Definition at line 61 of file principal_axes.h.

Member Function Documentation

◆ add_point()

void GEO::PrincipalAxes3d::add_point ( const vec3 p,
double  weight = 1.0 
)

Adds a point to the current principal axes estimation.

Parameters
[in]pthe current point
[in]weightan optional weight

◆ axis()

const vec3& GEO::PrincipalAxes3d::axis ( index_t  i) const
inline

Gets one of the axes.

Can be called only after end_points().

Parameters
[in]ione of 0,1,2
Returns
the axis.

Definition at line 101 of file principal_axes.h.

◆ center()

vec3 GEO::PrincipalAxes3d::center ( ) const
inline

Gets the center.

Can be called only after end_points().

Returns
the center of the point cloud.

Definition at line 91 of file principal_axes.h.

◆ eigen_value()

double GEO::PrincipalAxes3d::eigen_value ( index_t  i) const
inline

Gets one of the eigenvalues.

Can be called only after end_points().

Parameters
[in]ione of 0,1,2
Returns
the eigenvalue.

Definition at line 111 of file principal_axes.h.

◆ normal()

vec3 GEO::PrincipalAxes3d::normal ( ) const
inline

Gets the estimated normal to the point cloud.

Equivalent to axis(2).

Returns
the estimated normal.

Definition at line 120 of file principal_axes.h.


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