Represents a homogeneous 2D line. More...
#include <vgl_fwd.h>
Public Member Functions | |
| vgl_homg_line_2d () | |
| Default constructor (Line 1.y==0, the X axis). More... | |
| vgl_homg_line_2d (T va, T vb, T vc) | |
| Construct from three Types. More... | |
| vgl_homg_line_2d (const T v[3]) | |
| Construct from 3-vector. More... | |
| vgl_homg_line_2d (vgl_line_2d< T > const &p) | |
| Construct from non-homogeneous line. More... | |
| vgl_homg_line_2d (vgl_homg_point_2d< T > const &p1, vgl_homg_point_2d< T > const &p2) | |
| Construct from two distinct points (join). More... | |
| bool | operator== (vgl_homg_line_2d< T > const &l) const |
| the comparison operator. More... | |
| bool | operator!= (vgl_homg_line_2d< T > const &other) const |
| T | a () const |
| Parameter a of line a*x + b*y + c*w = 0. More... | |
| T | b () const |
| Parameter b of line a*x + b*y + c*w = 0. More... | |
| T | c () const |
| Parameter c of line a*x + b*y + c*w = 0. More... | |
| vgl_vector_2d< double > | direction () const |
| unit vector describing line direction, or (0,0) if line at infinity. More... | |
| vgl_vector_2d< double > | normal () const |
| unit vector orthogonal to line, or (0,0) if line at infinity. More... | |
| void | normalize () |
| divide all coefficients by sqrt(a^2 + b^2). More... | |
| void | set (T va, T vb, T vc) |
| Set a b c. More... | |
| bool | ideal (T tol=(T) 0) const |
| Return true iff this line is the line at infinity. More... | |
| void | get_two_points (vgl_homg_point_2d< T > &p1, vgl_homg_point_2d< T > &p2) const |
| get two points on the line. More... | |
Private Attributes | |
| T | a_ |
| the data associated with this line. More... | |
| T | b_ |
| T | c_ |
Related Functions | |
(Note that these are not member functions.) | |
| template<class T > | |
| vgl_homg_line_2d< T > | operator * (vnl_matrix_fixed< T, 3, 3 > const &m, vgl_homg_line_2d< T > const &p) |
| Transform a line through a 3x3 projective transformation matrix. More... | |
| template<class T > | |
| vgl_homg_point_2d< T > | vgl_closest_point (vgl_homg_line_2d< T > const &l, vgl_homg_point_2d< T > const &p) |
| Return the point on the given line closest to the given point. More... | |
| template<class T > | |
| double | vgl_distance_origin (vgl_homg_line_2d< T > const &l) |
| find the shortest distance of the line to the origin. More... | |
| template<class T > | |
| double | vgl_distance (vgl_homg_line_2d< T > const &l, vgl_homg_point_2d< T > const &p) |
| return the perpendicular distance from a point to a line in 2D. More... | |
| template<class T > | |
| bool | is_ideal (l const &line, T tol=(T) 0) |
| Return true iff line is the line at infinity. More... | |
| template<class T > | |
| 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 T > | |
| std::ostream & | operator<< (std::ostream &s, l const &line) |
| Print line equation to stream. More... | |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, l &line) |
| Load in line parameters from stream. More... | |
Represents a homogeneous 2D line.
|
inline |
Default constructor (Line 1.y==0, the X axis).
Definition at line 38 of file vgl_homg_line_2d.h.
|
inline |
Construct from three Types.
The three given numbers should not be all 0
Definition at line 42 of file vgl_homg_line_2d.h.
|
inline |
Construct from 3-vector.
The three given numbers should not be all 0
Definition at line 46 of file vgl_homg_line_2d.h.
| vgl_homg_line_2d< T >::vgl_homg_line_2d | ( | vgl_line_2d< T > const & | p | ) |
Construct from non-homogeneous line.
| vgl_homg_line_2d< T >::vgl_homg_line_2d | ( | vgl_homg_point_2d< T > const & | p1, |
| vgl_homg_point_2d< T > const & | p2 | ||
| ) |
Construct from two distinct points (join).
The two points must be distinct!
|
inline |
Parameter a of line a*x + b*y + c*w = 0.
Definition at line 80 of file vgl_homg_line_2d.h.
|
inline |
Parameter b of line a*x + b*y + c*w = 0.
Definition at line 82 of file vgl_homg_line_2d.h.
|
inline |
Parameter c of line a*x + b*y + c*w = 0.
Definition at line 84 of file vgl_homg_line_2d.h.
|
inline |
unit vector describing line direction, or (0,0) if line at infinity.
Definition at line 87 of file vgl_homg_line_2d.h.
| void vgl_homg_line_2d< Type >::get_two_points | ( | vgl_homg_point_2d< T > & | p1, |
| vgl_homg_point_2d< T > & | p2 | ||
| ) | const |
get two points on the line.
These two points are normally the intersections with the Y axis and X axis, respectively. When the line is parallel to one of these, the point with y=1 or x=1, resp. are taken. When the line goes through the origin, the second point is (b, -a, 1). Finally, when the line is the line at infinity, the returned points are (1,0,0) and (0,1,0). Thus, whenever possible, the returned points are not at infinity.
These two points are normally the intersections with the Y axis and X axis, respectively. When the line is parallel to one of these, the point with y/w=1 or x/w=1, resp. are taken. When the line goes through the origin, the second point is (b, -a, 1). Finally, when the line is the line at infinity, the returned points are (1,0,0) and (0,1,0).
Thus, whenever possible, the returned points are not at infinity.
Definition at line 33 of file vgl_homg_line_2d.hxx.
|
inline |
Return true iff this line is the line at infinity.
This version checks (max(|a|,|b|) <= tol * |c|
Definition at line 102 of file vgl_homg_line_2d.h.
|
inline |
unit vector orthogonal to line, or (0,0) if line at infinity.
Definition at line 90 of file vgl_homg_line_2d.h.
| void vgl_homg_line_2d< Type >::normalize | ( | ) |
divide all coefficients by sqrt(a^2 + b^2).
Definition at line 79 of file vgl_homg_line_2d.hxx.
|
inline |
Definition at line 75 of file vgl_homg_line_2d.h.
|
inline |
the comparison operator.
Definition at line 69 of file vgl_homg_line_2d.h.
|
inline |
Set a b c.
The three given numbers should not be all 0 Note that it does not make sense to set a, b or c separately
Definition at line 98 of file vgl_homg_line_2d.h.
Are three lines concurrent, i.e., do they pass through a common point?.
Definition at line 130 of file vgl_homg_line_2d.h.
|
related |
Return true iff line is the line at infinity.
This version checks (max(|a|,|b|) <= tol * |c|
Definition at line 125 of file vgl_homg_line_2d.h.
|
related |
Transform a line through a 3x3 projective transformation matrix.
Definition at line 909 of file vgl_homg_operators_2d.hxx.
|
related |
Print line equation to stream.
|
related |
Load in line parameters from stream.
|
related |
Return the point on the given line closest to the given point.
|
related |
return the perpendicular distance from a point to a line in 2D.
|
related |
find the shortest distance of the line to the origin.
|
private |
the data associated with this line.
Definition at line 29 of file vgl_homg_line_2d.h.
|
private |
Definition at line 30 of file vgl_homg_line_2d.h.
|
private |
Definition at line 31 of file vgl_homg_line_2d.h.
1.8.15