A class to hold a non-homogeneous representation of a 3D line. More...
#include <vgl_line_3d_2_points.h>
Public Member Functions | |
vgl_line_3d_2_points (void) | |
Default constructor with (0,0,0) and (1,0,0), which is the line y=z=0. | |
vgl_line_3d_2_points (const vgl_line_3d_2_points< Type > &that) | |
Copy constructor. | |
vgl_line_3d_2_points (vgl_point_3d< Type > const &p1, vgl_point_3d< Type > const &p2) | |
Construct from two points. | |
bool | operator== (vgl_line_3d_2_points< Type > const &l) const |
comparison. | |
bool | operator!= (vgl_line_3d_2_points< Type > const &l) const |
vgl_point_3d< Type > | point1 () const |
Return the first point representing this line. | |
vgl_point_3d< Type > | point2 () const |
Return the second point representing this line. | |
void | set (vgl_point_3d< Type > const &p1, vgl_point_3d< Type > const &p2) |
Assignment. | |
bool | ideal (Type=(Type) 0) const |
Return true iff line is at infinity (which is always false). | |
vgl_vector_3d< Type > | direction () const |
Return the direction vector of this line (not normalised - but perhaps it should be, like other line classes?). | |
vgl_point_3d< Type > | point_t (const double t) const |
Return a point on the line defined by a scalar parameter t such that t=0.0 at point1 and t=1.0 at point2. | |
Private Attributes | |
vgl_point_3d< Type > | point1_ |
Any point on the line. | |
vgl_point_3d< Type > | point2_ |
Any other point on the line. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
vcl_pair< vgl_point_3d< T > , vgl_point_3d< T > > | vgl_closest_points (const vgl_line_3d_2_points< T > &l1, const vgl_line_3d_2_points< T > &l2, bool *unique=0) |
Return the points of closest approach on 2 3D lines. | |
template<class T > | |
vcl_pair< vgl_point_3d< T > , vgl_point_3d< T > > | vgl_closest_points (const vgl_infinite_line_3d< T > &l1, const vgl_infinite_line_3d< T > &l2, bool *unique=0) |
Return the points of closest approach on two infinite 3D lines. | |
template<class T > | |
double | vgl_distance_origin (vgl_line_3d_2_points< T > const &l) |
find the shortest distance of the line to the origin. | |
template<class T > | |
double | vgl_distance (vgl_line_3d_2_points< T > const &l, vgl_point_3d< T > const &p) |
Return the perpendicular distance from a point to a line in 3D. | |
template<class T > | |
vgl_point_3d< T > | vgl_intersection (vgl_line_3d_2_points< T > const &l1, vgl_line_3d_2_points< T > const &l2) |
Return the intersection point of two concurrent lines. | |
template<class T > | |
bool | vgl_intersection (vgl_line_3d_2_points< T > const &l1, vgl_line_segment_3d< T > const &l2, vgl_point_3d< T > &i_pnt) |
Return the intersection point of segments of a concurrent line and line segment pair. Returns false if the intersection point is not inside both line segments. | |
template<class Type > | |
bool | is_ideal (l const &, Type=(Type) 0) |
Return true iff line is at infinity (which is always false). | |
template<class Type > | |
bool | coplanar (l const &l1, l const &l2) |
Are two lines coplanar, i.e., do they either intersect or are parallel?. | |
template<class Type > | |
bool | concurrent (l const &l1, l const &l2) |
Are two lines concurrent, i.e., do they intersect in a finite point?. | |
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?. | |
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?. | |
template<class Type > | |
vcl_ostream & | operator<< (vcl_ostream &s, l const &) |
Write to stream (verbose). | |
template<class Type > | |
vcl_istream & | operator>> (vcl_istream &is, l &) |
Read parameters from stream. |
A class to hold a non-homogeneous representation of a 3D line.
The line is stored as a pair of non-homogeneous 3D points.
Definition at line 26 of file vgl_line_3d_2_points.h.
vgl_line_3d_2_points< Type >::vgl_line_3d_2_points | ( | void | ) | [inline] |
Default constructor with (0,0,0) and (1,0,0), which is the line y=z=0.
Definition at line 41 of file vgl_line_3d_2_points.h.
vgl_line_3d_2_points< Type >::vgl_line_3d_2_points | ( | const vgl_line_3d_2_points< Type > & | that | ) | [inline] |
Copy constructor.
Definition at line 45 of file vgl_line_3d_2_points.h.
vgl_line_3d_2_points< Type >::vgl_line_3d_2_points | ( | vgl_point_3d< Type > const & | p1, |
vgl_point_3d< Type > const & | p2 | ||
) | [inline] |
Construct from two points.
Definition at line 49 of file vgl_line_3d_2_points.h.
vgl_vector_3d<Type> vgl_line_3d_2_points< Type >::direction | ( | ) | const [inline] |
Return the direction vector of this line (not normalised - but perhaps it should be, like other line classes?).
Definition at line 74 of file vgl_line_3d_2_points.h.
bool vgl_line_3d_2_points< Type >::ideal | ( | Type | = (Type)0 | ) | const [inline] |
Return true iff line is at infinity (which is always false).
Definition at line 71 of file vgl_line_3d_2_points.h.
bool vgl_line_3d_2_points< Type >::operator!= | ( | vgl_line_3d_2_points< Type > const & | l | ) | const [inline] |
Definition at line 55 of file vgl_line_3d_2_points.h.
bool vgl_line_3d_2_points< Type >::operator== | ( | vgl_line_3d_2_points< Type > const & | l | ) | const |
comparison.
Definition at line 21 of file vgl_line_3d_2_points.txx.
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point1 | ( | ) | const [inline] |
Return the first point representing this line.
Definition at line 60 of file vgl_line_3d_2_points.h.
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point2 | ( | ) | const [inline] |
Return the second point representing this line.
Definition at line 62 of file vgl_line_3d_2_points.h.
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point_t | ( | const double | t | ) | const [inline] |
Return a point on the line defined by a scalar parameter t such that t=0.0 at point1 and t=1.0 at point2.
Definition at line 78 of file vgl_line_3d_2_points.h.
void vgl_line_3d_2_points< Type >::set | ( | vgl_point_3d< Type > const & | p1, |
vgl_point_3d< Type > const & | p2 | ||
) | [inline] |
Assignment.
Definition at line 65 of file vgl_line_3d_2_points.h.
bool concurrent | ( | l const & | l1, |
l const & | l2 | ||
) | [related] |
Are two lines concurrent, i.e., do they intersect in a finite point?.
Definition at line 106 of file vgl_line_3d_2_points.h.
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 150 of file vgl_line_3d_2_points.h.
bool coplanar | ( | l const & | l1, |
l const & | l2 | ||
) | [related] |
Are two lines coplanar, i.e., do they either intersect or are parallel?.
Definition at line 100 of file vgl_line_3d_2_points.h.
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 121 of file vgl_line_3d_2_points.h.
bool is_ideal | ( | l const & | , |
Type | = (Type)0 |
||
) | [related] |
Return true iff line is at infinity (which is always false).
Definition at line 86 of file vgl_line_3d_2_points.h.
vcl_ostream & operator<< | ( | vcl_ostream & | s, |
l const & | |||
) | [related] |
Write to stream (verbose).
vcl_istream & operator>> | ( | vcl_istream & | is, |
l & | |||
) | [related] |
Read parameters from stream.
vcl_pair< vgl_point_3d< T >, vgl_point_3d< T > > vgl_closest_points | ( | const vgl_line_3d_2_points< T > & | l1, |
const vgl_line_3d_2_points< T > & | l2, | ||
bool * | unique = 0 |
||
) | [related] |
Return the points of closest approach on 2 3D lines.
Uses non-homogeneous representations.
unique | If provided, will be set to true if the returned points are unique, otherwise many solutions exist and the returned points are an arbitrary choice. The distance between the points is still valid, however. |
vcl_pair< vgl_point_3d< T >, vgl_point_3d< T > > vgl_closest_points | ( | const vgl_infinite_line_3d< T > & | l1, |
const vgl_infinite_line_3d< T > & | l2, | ||
bool * | unique = 0 |
||
) | [related] |
Return the points of closest approach on two infinite 3D lines.
Uses non-homogeneous representations.
unique | If provided, will be set to true if the returned points are unique, otherwise many solutions exist and the returned points are an arbitrary choice. The distance between the points is still valid, however. |
Definition at line 279 of file vgl_closest_point.h.
double vgl_distance | ( | vgl_line_3d_2_points< T > const & | l, |
vgl_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.
double vgl_distance_origin | ( | vgl_line_3d_2_points< T > const & | l | ) | [related] |
find the shortest distance of the line to the origin.
vgl_point_3d< T > vgl_intersection | ( | vgl_line_3d_2_points< T > const & | l1, |
vgl_line_3d_2_points< T > const & | l2 | ||
) | [related] |
Return the intersection point of two concurrent lines.
Allows intersection points outside the line segments Throws an assertion if lines not concurrent
bool vgl_intersection | ( | vgl_line_3d_2_points< T > const & | l1, |
vgl_line_segment_3d< T > const & | l2, | ||
vgl_point_3d< T > & | i_pnt | ||
) | [related] |
Return the intersection point of segments of a concurrent line and line segment pair. Returns false if the intersection point is not inside both line segments.
Return the intersection point of segments of two concurrent lines.
Definition at line 495 of file vgl_intersection.txx.
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point1_ [private] |
Any point on the line.
Definition at line 31 of file vgl_line_3d_2_points.h.
vgl_point_3d<Type> vgl_line_3d_2_points< Type >::point2_ [private] |
Any other point on the line.
Definition at line 33 of file vgl_line_3d_2_points.h.