#include <plane3.h>
Collaboration diagram for NUM::Plane3< T >:
Public Member Functions | |
Plane3 () | |
Construct a plane with coefficients not set up:. | |
Plane3 (const Vector3< T > &n, T d) | |
~Plane3 () | |
Destructor: A no-op. | |
Vector3< T > & | normal () |
Get (reference to) the plane normal vector; may be modified. | |
const Vector3< T > & | normal () const |
T & | dist () |
Get (reference to) the distance from origin; may be modified. | |
const T & | dist () const |
T | normalize () |
Normalize the plane normal vector; returns previous length. | |
T | distance (const Vector3< T > &point) |
int | compute (const Vector3< T > &p0, const Vector3< T > &p1, const Vector3< T > &p2) |
int | PointFit (int args_not_specified) |
Fit a 3d plane to best fit a number of specified points. | |
Private Attributes | |
Vector3< T > | _normal |
normal vector | |
T | _dist |
distance from origin |
Plane equation:
normal[0]*x[0] + normal[1]*x[1] + normal[2]*x[2] + dist = 0
Distance from plane: DotProduct(normal,point) + dist.
This class is meant to be quite fast and hence does applies some optimizations like:
Definition at line 54 of file plane3.h.
|
Construct a plane with coefficients not set up:.
|
|
Construct a plane with specified normal and distance from origin (oriented against normal vector). Definition at line 65 of file plane3.h. References NUM::Plane3< T >::_dist, and NUM::Plane3< T >::_normal. |
|
Destructor: A no-op.
|
|
Compute a 3d plane which is specified by 3 points on the plane.
Definition at line 39 of file plane3.cc. References NUM::Plane3< T >::_dist, NUM::Plane3< T >::_normal, NUM::dot(), and NUM::len(). |
|
Definition at line 75 of file plane3.h. References NUM::Plane3< T >::_dist. |
|
Get (reference to) the distance from origin; may be modified.
Definition at line 74 of file plane3.h. References NUM::Plane3< T >::_dist. |
|
Compute distance of point from plane: This assumes that the plane normal vector is normalized (length 1). Definition at line 83 of file plane3.h. References NUM::Plane3< T >::_dist, NUM::Plane3< T >::_normal, and NUM::dot(). |
|
Definition at line 71 of file plane3.h. References NUM::Plane3< T >::_normal. |
|
Get (reference to) the plane normal vector; may be modified.
Definition at line 70 of file plane3.h. References NUM::Plane3< T >::_normal. |
|
Normalize the plane normal vector; returns previous length.
Definition at line 78 of file plane3.h. References NUM::Plane3< T >::_normal. |
|
Fit a 3d plane to best fit a number of specified points. Not yet part of this implementation but code is ready:
If 3 points are specified, this will simply call compute(). The plane is stored in *this and the array dist[] (if non-NULL) will be filled with the actual distance of the points from the plane (one entry for each point).
|
|
distance from origin
Definition at line 58 of file plane3.h. Referenced by NUM::Plane3< T >::compute(), NUM::Plane3< T >::dist(), NUM::Plane3< T >::distance(), and NUM::Plane3< T >::Plane3(). |
|
normal vector
Definition at line 57 of file plane3.h. Referenced by NUM::Plane3< T >::compute(), NUM::Plane3< T >::distance(), NUM::Plane3< T >::normal(), NUM::Plane3< T >::normalize(), and NUM::Plane3< T >::Plane3(). |