Public Member Functions | Protected Member Functions | Private Attributes | Related Functions | List of all members
vgl_homg_line_3d_2_points< Type > Class Template Reference

Represents a homogeneous 3D line using two points. More...

#include <vgl_fwd.h>

Public Member Functions

 vgl_homg_line_3d_2_points (void)
 Default constructor with (0,0,0,1) and (1,0,0,0), which is the line y=z=0. More...
 
 vgl_homg_line_3d_2_points (const vgl_homg_line_3d_2_points< Type > &that)
 Copy constructor. More...
 
 vgl_homg_line_3d_2_points (vgl_homg_point_3d< Type > const &point_1, vgl_homg_point_3d< Type > const &point_2)
 Construct from two points. More...
 
bool operator== (vgl_homg_line_3d_2_points< Type > const &l) const
 comparison. More...
 
bool operator!= (vgl_homg_line_3d_2_points< Type > const &l) const
 
vgl_homg_point_3d< Type > point_finite () const
 Finite point (Could be an ideal point, if the whole line is at infinity.). More...
 
vgl_homg_point_3d< Type > point_infinite () const
 Infinite point: the intersection of the line with the plane at infinity. More...
 
vgl_vector_3d< Type > direction () const
 The point at infinity defines the direction of the line. More...
 
void set (vgl_homg_point_3d< Type > const &p1, vgl_homg_point_3d< Type > const &p2)
 Assignment. More...
 
bool ideal (Type tol=(Type) 0) const
 Return true iff line is at infinity. More...
 

Protected Member Functions

void force_point2_infinite (void) const
 force the point point_infinite_ to infinity, without changing the line. More...
 

Private Attributes

vgl_homg_point_3d< Type > point_finite_
 Any finite point on the line. More...
 
vgl_homg_point_3d< Type > point_infinite_
 the (unique) point at infinity. More...
 

Related Functions

(Note that these are not member functions.)

template<class T >
std::pair< vgl_homg_point_3d< T >, vgl_homg_point_3d< T > > vgl_closest_points (vgl_homg_line_3d_2_points< T > const &line1, vgl_homg_line_3d_2_points< T > const &line2)
 Return the two points of nearest approach of two 3D lines, one on each line. More...
 
template<class T >
double vgl_distance_origin (vgl_homg_line_3d_2_points< T > const &l)
 find the shortest distance of the line to the origin. More...
 
template<class T >
double vgl_distance (vgl_homg_line_3d_2_points< T > const &line1, vgl_homg_line_3d_2_points< T > const &line2)
 Return the perpendicular distance between two lines in 3D. More...
 
template<class T >
double vgl_distance (vgl_homg_line_3d_2_points< T > const &l, vgl_homg_point_3d< T > const &p)
 Return the perpendicular distance from a point to a line in 3D. More...
 
template<class Type >
bool is_ideal (l const &line, Type tol=(Type) 0)
 Return true iff line is at infinity. More...
 
template<class Type >
bool coplanar (l const &l1, l const &l2)
 Are two lines coplanar, i.e., do they intersect?. More...
 
template<class Type >
bool concurrent (l const &l1, l const &l2)
 Are two lines concurrent, i.e., do they intersect?. More...
 
template<class Type >
bool coplanar (l const &l1, l const &l2, l const &l3)
 Are three lines coplanar, i.e., are they in a common plane?. More...
 
template<class Type >
vgl_homg_point_3d< Type > intersection (l const &l1, l const &l2)
 Return the intersection point of two concurrent lines. More...
 
template<class Type >
bool concurrent (l const &l1, l const &l2, l const &l3)
 Are three lines concurrent, i.e., do they pass through a common point?. More...
 
template<class Type >
std::ostream & operator<< (std::ostream &s, l const &p)
 Write to stream (verbose). More...
 
template<class Type >
std::istream & operator>> (std::istream &is, l &p)
 Read parameters from stream. More...
 

Detailed Description

template<class Type>
class vgl_homg_line_3d_2_points< Type >

Represents a homogeneous 3D line using two points.

A class to hold a homogeneous representation of a 3D Line. The line is stored as a pair of homogeneous 3d points.

Definition at line 15 of file vgl_fwd.h.

Constructor & Destructor Documentation

◆ vgl_homg_line_3d_2_points() [1/3]

template<class Type>
vgl_homg_line_3d_2_points< Type >::vgl_homg_line_3d_2_points ( void  )
inline

Default constructor with (0,0,0,1) and (1,0,0,0), which is the line y=z=0.

Definition at line 40 of file vgl_homg_line_3d_2_points.h.

◆ vgl_homg_line_3d_2_points() [2/3]

template<class Type>
vgl_homg_line_3d_2_points< Type >::vgl_homg_line_3d_2_points ( const vgl_homg_line_3d_2_points< Type > &  that)
inline

Copy constructor.

Definition at line 44 of file vgl_homg_line_3d_2_points.h.

◆ vgl_homg_line_3d_2_points() [3/3]

template<class Type>
vgl_homg_line_3d_2_points< Type >::vgl_homg_line_3d_2_points ( vgl_homg_point_3d< Type > const &  point_1,
vgl_homg_point_3d< Type > const &  point_2 
)
inline

Construct from two points.

Definition at line 48 of file vgl_homg_line_3d_2_points.h.

Member Function Documentation

◆ direction()

template<class Type>
vgl_vector_3d<Type> vgl_homg_line_3d_2_points< Type >::direction ( ) const
inline

The point at infinity defines the direction of the line.

Definition at line 69 of file vgl_homg_line_3d_2_points.h.

◆ force_point2_infinite()

template<class Type >
void vgl_homg_line_3d_2_points< Type >::force_point2_infinite ( void  ) const
protected

force the point point_infinite_ to infinity, without changing the line.

This is called by the constructors

Definition at line 44 of file vgl_homg_line_3d_2_points.hxx.

◆ ideal()

template<class Type>
bool vgl_homg_line_3d_2_points< Type >::ideal ( Type  tol = (Type)0) const
inline

Return true iff line is at infinity.

Definition at line 80 of file vgl_homg_line_3d_2_points.h.

◆ operator!=()

template<class Type>
bool vgl_homg_line_3d_2_points< Type >::operator!= ( vgl_homg_line_3d_2_points< Type > const &  l) const
inline

Definition at line 59 of file vgl_homg_line_3d_2_points.h.

◆ operator==()

template<class Type >
bool vgl_homg_line_3d_2_points< Type >::operator== ( vgl_homg_line_3d_2_points< Type > const &  l) const

comparison.

Definition at line 25 of file vgl_homg_line_3d_2_points.hxx.

◆ point_finite()

template<class Type>
vgl_homg_point_3d<Type> vgl_homg_line_3d_2_points< Type >::point_finite ( ) const
inline

Finite point (Could be an ideal point, if the whole line is at infinity.).

Definition at line 64 of file vgl_homg_line_3d_2_points.h.

◆ point_infinite()

template<class Type>
vgl_homg_point_3d<Type> vgl_homg_line_3d_2_points< Type >::point_infinite ( ) const
inline

Infinite point: the intersection of the line with the plane at infinity.

Definition at line 66 of file vgl_homg_line_3d_2_points.h.

◆ set()

template<class Type>
void vgl_homg_line_3d_2_points< Type >::set ( vgl_homg_point_3d< Type > const &  p1,
vgl_homg_point_3d< Type > const &  p2 
)
inline

Assignment.

Definition at line 74 of file vgl_homg_line_3d_2_points.h.

Friends And Related Function Documentation

◆ concurrent() [1/2]

template<class Type >
bool concurrent ( l const &  l1,
l const &  l2 
)
related

Are two lines concurrent, i.e., do they intersect?.

Definition at line 112 of file vgl_homg_line_3d_2_points.h.

◆ concurrent() [2/2]

template<class Type >
bool concurrent ( l const &  l1,
l const &  l2,
l const &  l3 
)
related

Are three lines concurrent, i.e., do they pass through a common point?.

Definition at line 141 of file vgl_homg_line_3d_2_points.h.

◆ coplanar() [1/2]

template<class Type >
bool coplanar ( l const &  l1,
l const &  l2 
)
related

Are two lines coplanar, i.e., do they intersect?.

Definition at line 106 of file vgl_homg_line_3d_2_points.h.

◆ coplanar() [2/2]

template<class Type >
bool coplanar ( l const &  l1,
l const &  l2,
l const &  l3 
)
related

Are three lines coplanar, i.e., are they in a common plane?.

Definition at line 124 of file vgl_homg_line_3d_2_points.h.

◆ intersection()

template<class Type >
vgl_homg_point_3d< Type > intersection ( l const &  l1,
l const &  l2 
)
related

Return the intersection point of two concurrent lines.

◆ is_ideal()

template<class Type >
bool is_ideal ( l const &  line,
Type  tol = (Type)0 
)
related

Return true iff line is at infinity.

Definition at line 93 of file vgl_homg_line_3d_2_points.h.

◆ operator<<()

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

Write to stream (verbose).

◆ operator>>()

template<class Type >
std::istream & operator>> ( std::istream &  is,
l p 
)
related

Read parameters from stream.

◆ vgl_closest_points()

template<class T >
std::pair< vgl_homg_point_3d< T >, vgl_homg_point_3d< T > > vgl_closest_points ( vgl_homg_line_3d_2_points< T > const &  line1,
vgl_homg_line_3d_2_points< T > const &  line2 
)
related

Return the two points of nearest approach of two 3D lines, one on each line.

There are 3 cases: the lines intersect (hence these two points are equal); the lines are parallel (an infinite number of solutions viz all points); the lines are neither parallel nor do they intersect (the general case). This method handles all 3 cases. In all cases, a pair of points is returned; in case 1, the two returned points are equal; in case 2, both points are the common point at infinity of the two lines.

Note that case 2 also comprises the case where the given lines are identical. Hence, when observing a point at infinity as a return value, one should interpret this as "all points are closest points".

Parameters
line1
line2
Returns
std::pair<vgl_homg_point_3d<T>,vgl_homg_point_3d<T> >
Author
Paul Bourke, modified for use in VXL by Brendan McCane
Note
This routine is adapted from code written by Paul Bourke and available online at http://astronomy.swin.edu.au/~pbourke/geometry/lineline3d/

◆ vgl_distance() [1/2]

template<class T >
double vgl_distance ( vgl_homg_line_3d_2_points< T > const &  line1,
vgl_homg_line_3d_2_points< T > const &  line2 
)
related

Return the perpendicular distance between two lines in 3D.

See vgl_closest_point.h for more information.

◆ vgl_distance() [2/2]

template<class T >
double vgl_distance ( vgl_homg_line_3d_2_points< T > const &  l,
vgl_homg_point_3d< T > const &  p 
)
related

Return the perpendicular distance from a point to a line in 3D.

See vgl_closest_point.h for more information.

◆ vgl_distance_origin()

template<class T >
double vgl_distance_origin ( vgl_homg_line_3d_2_points< T > const &  l)
related

find the shortest distance of the line to the origin.

Member Data Documentation

◆ point_finite_

template<class Type>
vgl_homg_point_3d<Type> vgl_homg_line_3d_2_points< Type >::point_finite_
mutableprivate

Any finite point on the line.

Definition at line 30 of file vgl_homg_line_3d_2_points.h.

◆ point_infinite_

template<class Type>
vgl_homg_point_3d<Type> vgl_homg_line_3d_2_points< Type >::point_infinite_
mutableprivate

the (unique) point at infinity.

Definition at line 32 of file vgl_homg_line_3d_2_points.h.


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