Public Member Functions | Private Attributes | Related Functions | List of all members
vgl_plane_3d< T > Class Template Reference

Represents a Euclidean 3D plane. More...

#include <vgl_fwd.h>

Public Member Functions

 vgl_plane_3d ()
 
 vgl_plane_3d (T ta, T tb, T tc, T td)
 Construct a vgl_plane_3d from its equation $ax+by+cz+d=0$. More...
 
 vgl_plane_3d (const T v[4])
 Construct a vgl_plane_3d from its equation $v[0]x+v[1]y+v[2]z+v[3]=0$. More...
 
 vgl_plane_3d (vgl_homg_plane_3d< T > const &p)
 Construct from a homogeneous plane. More...
 
 vgl_plane_3d (vgl_vector_3d< T > const &normal, vgl_point_3d< T > const &p)
 Construct from Normal and a point. More...
 
 vgl_plane_3d (vgl_point_3d< T > const &p1, vgl_point_3d< T > const &p2, vgl_point_3d< T > const &p3)
 Construct from three non-collinear points. More...
 
 vgl_plane_3d (vgl_ray_3d< T > const &r0, vgl_ray_3d< T > const &r1)
 Construct from two non-skew rays. The rays intersect at their origins. More...
 
a () const
 Return x coefficient. More...
 
nx () const
 
b () const
 Return y coefficient. More...
 
ny () const
 
c () const
 Return z coefficient. More...
 
nz () const
 
d () const
 Return constant coefficient. More...
 
void set (T ta, T tb, T tc, T td)
 Set this vgl_plane_3d to have the equation $ax+by+cz+d=0$. More...
 
bool operator== (vgl_plane_3d< T > const &p) const
 the comparison operator. More...
 
bool operator!= (vgl_plane_3d< T >const &p) const
 
bool ideal (T=(T) 0) const
 Return true iff the plane is the plane at infinity. More...
 
bool normalize ()
 
vgl_vector_3d< T > normal () const
 Return the normal direction, i.e., a unit vector orthogonal to this plane. More...
 
bool contains (vgl_point_3d< T > const &p, T tol=(T) 0) const
 Return true if p is on the plane. More...
 
bool plane_coords (vgl_point_3d< T > const &p3d, vgl_point_2d< T > &p2d, T tol=(T) 0) const
 Given a 3-d point, return a 2-d point in the coord. system of the plane. More...
 
vgl_point_3d< T > world_coords (vgl_point_2d< T > const &p2d) const
 inverse map from plane coordinates to world coordinates. More...
 
void plane_coord_vectors (vgl_vector_3d< T > &uvec, vgl_vector_3d< T > &vvec) const
 plane coordinate unit vectors. More...
 

Private Attributes

a_
 
b_
 
c_
 
d_
 

Related Functions

(Note that these are not member functions.)

template<class T >
vgl_point_3d< T > vgl_intersection (const std::vector< vgl_plane_3d< T > > &p)
 Return the intersection point of vector of planes. More...
 
template<class T >
vgl_point_3d< T > vgl_closest_point (vgl_plane_3d< T > const &pl, vgl_point_3d< T > const &p)
 Return the point on the given plane closest to the given point. More...
 
template<class T >
double vgl_distance_origin (vgl_plane_3d< T > const &pl)
 find the shortest distance of the plane to the origin. More...
 
template<class T >
double vgl_distance (vgl_plane_3d< T > const &l, vgl_point_3d< T > const &p)
 return the perpendicular distance from a point to a plane in 3D. More...
 
template<class T >
vgl_point_3d< T > vgl_intersection (vgl_line_3d_2_points< T > const &line, vgl_plane_3d< T > const &plane)
 Return the intersection point of a line and a plane. More...
 
template<class T >
bool vgl_intersection (vgl_line_segment_3d< T > const &line, vgl_plane_3d< T > const &plane, vgl_point_3d< T > &i_pt)
 Return the intersection point of a line and a plane. More...
 
template<class T >
bool vgl_intersection (vgl_infinite_line_3d< T > const &line, vgl_plane_3d< T > const &plane, vgl_point_3d< T > &i_pt)
 Return the intersection point of a line and a plane. More...
 
template<class T >
bool vgl_intersection (vgl_ray_3d< T > const &ray, vgl_plane_3d< T > const &plane, vgl_point_3d< T > &i_pt)
 Return the intersection point of a ray and a plane. More...
 
template<class T >
bool vgl_intersection (vgl_plane_3d< T > const &plane0, vgl_plane_3d< T > const &plane1, vgl_line_segment_3d< T > &line)
 Return the intersection line of two planes. More...
 
template<class T >
vgl_point_3d< T > vgl_intersection (vgl_plane_3d< T > const &p1, vgl_plane_3d< T > const &p2, vgl_plane_3d< T > const &p3)
 Return the intersection point of three planes. More...
 
template<class T >
bool vgl_intersection (vgl_plane_3d< T > const &plane0, vgl_plane_3d< T > const &plane1, vgl_infinite_line_3d< T > &line)
 Return the intersection line of two planes. Returns false if planes. More...
 
template<class T >
std::ostream & operator<< (std::ostream &s, const vgl_plane_3d< T > &p)
 Write to stream. More...
 
template<class T >
std::istream & operator>> (std::istream &is, vgl_plane_3d< T > &p)
 Read in four plane parameters from stream. More...
 

Detailed Description

template<class T>
class vgl_plane_3d< T >

Represents a Euclidean 3D plane.

The equation of the plane is $ a x + b y + c z + d = 0 $

Definition at line 23 of file vgl_fwd.h.

Constructor & Destructor Documentation

◆ vgl_plane_3d() [1/7]

template<class T>
vgl_plane_3d< T >::vgl_plane_3d ( )
inline

Definition at line 45 of file vgl_plane_3d.h.

◆ vgl_plane_3d() [2/7]

template<class T>
vgl_plane_3d< T >::vgl_plane_3d ( ta,
tb,
tc,
td 
)
inline

Construct a vgl_plane_3d from its equation $ax+by+cz+d=0$.

At least one of a, b or c should be nonzero.

Definition at line 60 of file vgl_plane_3d.h.

◆ vgl_plane_3d() [3/7]

template<class T>
vgl_plane_3d< T >::vgl_plane_3d ( const T  v[4])
inline

Construct a vgl_plane_3d from its equation $v[0]x+v[1]y+v[2]z+v[3]=0$.

At least one of v[0], v[1] or v[2] should be nonzero.

Definition at line 65 of file vgl_plane_3d.h.

◆ vgl_plane_3d() [4/7]

template<class T >
vgl_plane_3d< T >::vgl_plane_3d ( vgl_homg_plane_3d< T > const &  p)

Construct from a homogeneous plane.

Construct from homogeneous plane.

Definition at line 25 of file vgl_plane_3d.hxx.

◆ vgl_plane_3d() [5/7]

template<class T >
vgl_plane_3d< T >::vgl_plane_3d ( vgl_vector_3d< T > const &  normal,
vgl_point_3d< T > const &  p 
)

Construct from Normal and a point.

Construct from normal and a point.

The plane goes through the point p and will be orthogonal to normal.

Definition at line 51 of file vgl_plane_3d.hxx.

◆ vgl_plane_3d() [6/7]

template<class T >
vgl_plane_3d< T >::vgl_plane_3d ( vgl_point_3d< T > const &  p1,
vgl_point_3d< T > const &  p2,
vgl_point_3d< T > const &  p3 
)

Construct from three non-collinear points.

Construct from three points.

The plane will contain all three points p1, p2 and p3.

Definition at line 30 of file vgl_plane_3d.hxx.

◆ vgl_plane_3d() [7/7]

template<class T >
vgl_plane_3d< T >::vgl_plane_3d ( vgl_ray_3d< T > const &  r0,
vgl_ray_3d< T > const &  r1 
)

Construct from two non-skew rays. The rays intersect at their origins.

or are parallel. The plane will contain the two rays

Definition at line 59 of file vgl_plane_3d.hxx.

Member Function Documentation

◆ a()

template<class T>
T vgl_plane_3d< T >::a ( ) const
inline

Return x coefficient.

Definition at line 89 of file vgl_plane_3d.h.

◆ b()

template<class T>
T vgl_plane_3d< T >::b ( ) const
inline

Return y coefficient.

Definition at line 92 of file vgl_plane_3d.h.

◆ c()

template<class T>
T vgl_plane_3d< T >::c ( ) const
inline

Return z coefficient.

Definition at line 95 of file vgl_plane_3d.h.

◆ contains()

template<class T >
bool vgl_plane_3d< T >::contains ( vgl_point_3d< T > const &  p,
tol = (T)0 
) const

Return true if p is on the plane.

Definition at line 111 of file vgl_plane_3d.hxx.

◆ d()

template<class T>
T vgl_plane_3d< T >::d ( ) const
inline

Return constant coefficient.

Definition at line 98 of file vgl_plane_3d.h.

◆ ideal()

template<class T>
bool vgl_plane_3d< T >::ideal ( = (T)0) const
inline

Return true iff the plane is the plane at infinity.

Always returns false

Definition at line 110 of file vgl_plane_3d.h.

◆ normal()

template<class T>
vgl_vector_3d<T> vgl_plane_3d< T >::normal ( ) const
inline

Return the normal direction, i.e., a unit vector orthogonal to this plane.

Definition at line 116 of file vgl_plane_3d.h.

◆ normalize()

template<class T >
bool vgl_plane_3d< T >::normalize ( )

Definition at line 93 of file vgl_plane_3d.hxx.

◆ nx()

template<class T>
T vgl_plane_3d< T >::nx ( ) const
inline

Definition at line 90 of file vgl_plane_3d.h.

◆ ny()

template<class T>
T vgl_plane_3d< T >::ny ( ) const
inline

Definition at line 93 of file vgl_plane_3d.h.

◆ nz()

template<class T>
T vgl_plane_3d< T >::nz ( ) const
inline

Definition at line 96 of file vgl_plane_3d.h.

◆ operator!=()

template<class T>
bool vgl_plane_3d< T >::operator!= ( vgl_plane_3d< T >const &  p) const
inline

Definition at line 106 of file vgl_plane_3d.h.

◆ operator==()

template<class T >
bool vgl_plane_3d< T >::operator== ( vgl_plane_3d< T > const &  p) const

the comparison operator.

The equations need not be identical, but just equivalent.

Definition at line 120 of file vgl_plane_3d.hxx.

◆ plane_coord_vectors()

template<class T >
void vgl_plane_3d< T >::plane_coord_vectors ( vgl_vector_3d< T > &  uvec,
vgl_vector_3d< T > &  vvec 
) const

plane coordinate unit vectors.

Definition at line 203 of file vgl_plane_3d.hxx.

◆ plane_coords()

template<class T >
bool vgl_plane_3d< T >::plane_coords ( vgl_point_3d< T > const &  p3d,
vgl_point_2d< T > &  p2d,
tol = (T)0 
) const

Given a 3-d point, return a 2-d point in the coord. system of the plane.

If the point is not on the plane then false is returned

Definition at line 226 of file vgl_plane_3d.hxx.

◆ set()

template<class T>
void vgl_plane_3d< T >::set ( ta,
tb,
tc,
td 
)
inline

Set this vgl_plane_3d to have the equation $ax+by+cz+d=0$.

Definition at line 101 of file vgl_plane_3d.h.

◆ world_coords()

template<class T >
vgl_point_3d< T > vgl_plane_3d< T >::world_coords ( vgl_point_2d< T > const &  p2d) const

inverse map from plane coordinates to world coordinates.

Definition at line 247 of file vgl_plane_3d.hxx.

Friends And Related Function Documentation

◆ operator<<()

template<class T >
std::ostream & operator<< ( std::ostream &  s,
const vgl_plane_3d< T > &  p 
)
related

Write to stream.

◆ operator>>()

template<class T >
std::istream & operator>> ( std::istream &  is,
vgl_plane_3d< T > &  p 
)
related

Read in four plane parameters from stream.

Either just reads four blank-separated numbers, or reads four comma-separated numbers, or reads four numbers in parenthesized form "(123, 321, -456, 777)" or reads a formatted line equation "123x+321y-456z+777=0"

◆ vgl_closest_point()

template<class T >
vgl_point_3d< T > vgl_closest_point ( vgl_plane_3d< T > const &  pl,
vgl_point_3d< T > const &  p 
)
related

Return the point on the given plane closest to the given point.

◆ vgl_distance()

template<class T >
double vgl_distance ( vgl_plane_3d< T > const &  l,
vgl_point_3d< T > const &  p 
)
related

return the perpendicular distance from a point to a plane in 3D.

◆ vgl_distance_origin()

template<class T >
double vgl_distance_origin ( vgl_plane_3d< T > const &  pl)
related

find the shortest distance of the plane to the origin.

◆ vgl_intersection() [1/8]

template<class T >
vgl_point_3d< T > vgl_intersection ( const std::vector< vgl_plane_3d< T > > &  p)
related

Return the intersection point of vector of planes.

◆ vgl_intersection() [2/8]

template<class T >
vgl_point_3d< T > vgl_intersection ( vgl_line_3d_2_points< T > const &  line,
vgl_plane_3d< T > const &  plane 
)
related

Return the intersection point of a line and a plane.

Definition at line 598 of file vgl_intersection.hxx.

◆ vgl_intersection() [3/8]

template<class T >
bool vgl_intersection ( vgl_line_segment_3d< T > const &  line,
vgl_plane_3d< T > const &  plane,
vgl_point_3d< T > &  i_pt 
)
related

Return the intersection point of a line and a plane.

Definition at line 638 of file vgl_intersection.hxx.

◆ vgl_intersection() [4/8]

template<class T >
bool vgl_intersection ( vgl_infinite_line_3d< T > const &  line,
vgl_plane_3d< T > const &  plane,
vgl_point_3d< T > &  i_pt 
)
related

Return the intersection point of a line and a plane.

◆ vgl_intersection() [5/8]

template<class T >
bool vgl_intersection ( vgl_ray_3d< T > const &  ray,
vgl_plane_3d< T > const &  plane,
vgl_point_3d< T > &  i_pt 
)
related

Return the intersection point of a ray and a plane.

◆ vgl_intersection() [6/8]

template<class T >
bool vgl_intersection ( vgl_plane_3d< T > const &  plane0,
vgl_plane_3d< T > const &  plane1,
vgl_line_segment_3d< T > &  line 
)
related

Return the intersection line of two planes.

Returns false if planes are effectively parallel

Definition at line 161 of file vgl_intersection.h.

◆ vgl_intersection() [7/8]

template<class T >
vgl_point_3d< T > vgl_intersection ( vgl_plane_3d< T > const &  p1,
vgl_plane_3d< T > const &  p2,
vgl_plane_3d< T > const &  p3 
)
related

Return the intersection point of three planes.

Definition at line 858 of file vgl_intersection.hxx.

◆ vgl_intersection() [8/8]

template<class T >
bool vgl_intersection ( vgl_plane_3d< T > const &  plane0,
vgl_plane_3d< T > const &  plane1,
vgl_infinite_line_3d< T > &  line 
)
related

Return the intersection line of two planes. Returns false if planes.

are effectively parallel

Definition at line 780 of file vgl_intersection.hxx.

Member Data Documentation

◆ a_

template<class T>
T vgl_plane_3d< T >::a_
private

Definition at line 35 of file vgl_plane_3d.h.

◆ b_

template<class T>
T vgl_plane_3d< T >::b_
private

Definition at line 36 of file vgl_plane_3d.h.

◆ c_

template<class T>
T vgl_plane_3d< T >::c_
private

Definition at line 37 of file vgl_plane_3d.h.

◆ d_

template<class T>
T vgl_plane_3d< T >::d_
private

Definition at line 38 of file vgl_plane_3d.h.


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