The plane is defined by its (unit) normal vector and parameter 'd', which is the signed distance of the plane from the origin of the coordinate system. More...
#include <plane.H>
Inheritance diagram for mlib::Plane< PLANE, P, V, L >:
Public Member Functions | |
double | dist (const P &p) const |
Computes the distance from the given point to the nearest point on the plane. | |
P | intersect (const L &l) const |
Computes the intersection point of the given line and the plane. | |
Constructors | |
Plane () | |
Default constructor. Creates a plane with a zero offset from the origin and default constructed vector. | |
Plane (const V &n, double d) | |
Constructor that creates a plane with the normal and offset set to the values passed as arguments. | |
Plane (const P &p, const V &n) | |
Constructor that creates a plane that passes through the point p and that has normal n . | |
Plane (const P &p1, const P &p2, const P &p3) | |
Constructor that creates a plane that contains the three points p1 , p2 and p3 . | |
Plane (const P &, const V &, const V &) | |
Constructor that creates a plane that contains the given piont and two given vectors. | |
Plane (const P plg[], int n) | |
Create plane from a polygon of vertices (n >=3). | |
Plane (const P plg[], int n, const V &normal) | |
The plane normal is given, just calculate the 'd' parameter from all polygon vertices. | |
Accessor Functions | |
V & | normal () |
const V & | normal () const |
double & | d () |
double | d () const |
Plane Property Queries | |
P | origin () const |
bool | is_valid () const |
Is the plane valid (i.e. does it have a unit length normal)? | |
Plane Comparison Functions | |
bool | is_parallel (const PLANE &p) const |
Are the two planes parallel? | |
bool | is_equal (const PLANE &p) const |
Are the two planes equivalent? | |
Overloaded Arithmetic Operators | |
PLANE | operator- () const |
Negates the plane's normal vector and offset. | |
Projection Functions | |
P | project (const P &) const |
Projects the given point on to the plane. | |
V | project (const V &) const |
Projects the given vector on to the plane. | |
L | project (const L &) const |
Projects the given line on to the plane. | |
Protected Attributes | |
V | _normal |
double | _d |
Related Functions | |
(Note that these are not member functions.) | |
P | plane_intersect (const P &pt, const V &D, const P &O, const V &N) |
Computes the intersection of the ray defined by point pt and vector D and the plane defined by point O and normal vector N . | |
double | axis_ang (const P &p1, const P &p2, const P &axispt, const V &axis) |
The plane is defined by its (unit) normal vector and parameter 'd', which is the signed distance of the plane from the origin of the coordinate system.
For all points on the plane holds:
normal * point + d = 0
The plane parameters are accessed via public accessor methods 'normal' and 'd'.
If the plane is invalid (cannot be constructed), the plane normal is set to a null vector.
Definition at line 36 of file plane.H.
|
Default constructor. Creates a plane with a zero offset from the origin and default constructed vector. This most likely creates an invalid plane with a zero length vector. |
|
Constructor that creates a plane with the normal and offset set to the values passed as arguments.
|
|
Constructor that creates a plane that passes through the point
|
|
Constructor that creates a plane that contains the three points
|
|
Constructor that creates a plane that contains the given piont and two given vectors.
Definition at line 15 of file plane.C. References mlib::cross(). |
|
Create plane from a polygon of vertices (n >=3). All polygon vertices are used to calculate the plane coefficients to make the formula symetrical. Definition at line 28 of file plane.C. References mlib::Plane< PLANE, P, V, L >::_d, mlib::Plane< PLANE, P, V, L >::_normal, mlib::Plane< PLANE, P, V, L >::d(), and mlib::gEpsZeroMath. |
|
The plane normal is given, just calculate the 'd' parameter from all polygon vertices.
Definition at line 92 of file plane.C. References mlib::Plane< PLANE, P, V, L >::_d, and mlib::Plane< PLANE, P, V, L >::_normal. |
|
|
|
Definition at line 88 of file plane.H. Referenced by operator>>(), and mlib::Plane< PLANE, P, V, L >::Plane(). |
|
Computes the distance from the given point to the nearest point on the plane.
Definition at line 139 of file plane.H. Referenced by mlib::Wpt_list::get_plane(), and mlib::Plane< PLANE, P, V, L >::project(). |
|
Computes the intersection point of the given line and the plane.
Definition at line 142 of file plane.H. Referenced by Bface::plane_intersect(), and Cam_int::up(). |
|
Are the two planes equivalent?
|
|
Are the two planes parallel?
|
|
Is the plane valid (i.e. does it have a unit length normal)?
Definition at line 99 of file plane.H. Referenced by mlib::Wpt_list::is_planar(). |
|
|
|
Definition at line 85 of file plane.H. Referenced by mlib::Wpt_list::get_plane_normal(), and operator>>(). |
|
Negates the plane's normal vector and offset.
|
|
Definition at line 96 of file plane.H. Referenced by mlib::Plane< Wplane, Wpt, Wvec, Wline >::intersect(). |
|
Projects the given line on to the plane.
Definition at line 131 of file plane.C. References mlib::Plane< PLANE, P, V, L >::project(). |
|
Projects the given vector on to the plane.
Definition at line 121 of file plane.C. References mlib::Plane< PLANE, P, V, L >::_normal. |
|
Projects the given point on to the plane.
Definition at line 111 of file plane.C. References mlib::Plane< PLANE, P, V, L >::_normal, and mlib::Plane< PLANE, P, V, L >::dist(). Referenced by mlib::Plane< PLANE, P, V, L >::project(). |
|
Definition at line 172 of file plane.H. References mlib::Acos(), and mlib::cross(). |
|
Computes the intersection of the ray defined by point
Definition at line 157 of file plane.H. Referenced by mlib::Plane< Wplane, Wpt, Wvec, Wline >::intersect(). |
|
|