Classes | Macros | Functions
vgl_homg_line_2d.h File Reference

line in projective 2D space More...

#include <iosfwd>
#include <vgl/vgl_fwd.h>
#include <cassert>
#include <vgl/vgl_vector_2d.h>

Go to the source code of this file.

Classes

class  vgl_homg_line_2d< T >
 Represents a homogeneous 2D line. More...
 

Macros

#define vgl_Abs(x)   ((x)<0?-(x):(x))
 
#define l   vgl_homg_line_2d<T>
 
#define VGL_HOMG_LINE_2D_INSTANTIATE(T)   extern "please include vgl/vgl_homg_line_2d.hxx first"
 

Functions

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...
 

Detailed Description

line in projective 2D space

Author
Don Hamilton, Peter Tu
  Modifications
   Peter Vanroose -  6 July 2001 - Added normal(), direction() and concurrent()
   Peter Vanroose -  4 July 2001 - Added assertions and cstr from non-homg line
   Peter Vanroose - 27 June 2001 - Added operator==

Definition in file vgl_homg_line_2d.h.

Macro Definition Documentation

◆ l

#define l   vgl_homg_line_2d<T>

Definition at line 119 of file vgl_homg_line_2d.h.

◆ vgl_Abs

#define vgl_Abs (   x)    ((x)<0?-(x):(x))

◆ VGL_HOMG_LINE_2D_INSTANTIATE

#define VGL_HOMG_LINE_2D_INSTANTIATE (   T)    extern "please include vgl/vgl_homg_line_2d.hxx first"

Definition at line 149 of file vgl_homg_line_2d.h.

Function Documentation

◆ concurrent()

template<class T >
bool concurrent ( l const &  l1,
l const &  l2,
l const &  l3 
)
inline

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

Definition at line 130 of file vgl_homg_line_2d.h.

◆ is_ideal()

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

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.

◆ operator<<()

template<class T >
std::ostream & operator<< ( std::ostream &  s,
l const &  line 
)

Print line equation to stream.

Write line description to stream: "<vgl_line_2d ax+by+c>".

Write to stream (verbose).

◆ operator>>()

template<class T >
std::istream & operator>> ( std::istream &  s,
l line 
)

Load in line parameters from stream.

Read in three line parameters from stream.

Read parameters from stream.

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