Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

vgl_line_segment_2d< Type > Class Template Reference

#include <vgl_line_segment_2d.h>

List of all members.


Detailed Description

template<class Type>
class vgl_line_segment_2d< Type >

Represents a 2D line segment using two points.

Definition at line 23 of file vgl_line_segment_2d.h.

Public Member Functions

 vgl_line_segment_2d ()
 Default constructor - does not initialise!.
 vgl_line_segment_2d (vgl_line_segment_2d< Type > const &l)
 Copy constructor.
 vgl_line_segment_2d (vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2)
 Construct from two end points.
 ~vgl_line_segment_2d ()
 Destructor.
vgl_point_2d< Type > point1 () const
 One end-point of the line segment.
vgl_point_2d< Type > point2 () const
 The other end-point of the line segment.
bool operator== (vgl_line_segment_2d< Type > const &l) const
 The equality comparison operator.
bool operator!= (vgl_line_segment_2d< Type >const &other) const
 The inequality comparison operator.
Type a () const
 Parameter a of line a*x + b*y + c = 0.
Type b () const
 Parameter b of line a*x + b*y + c = 0.
Type c () const
 Parameter c of line a*x + b*y + c = 0.
vgl_vector_2d< double > direction () const
 unit vector describing line direction.
vgl_vector_2d< double > normal () const
 unit vector orthogonal to line.
double slope_radians () const
 angle with the oriented horizontal line y=0, measured in radians.
double slope_degrees () const
 angle with the oriented horizontal line y=0, measured in 360-degrees.
void set (vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2)
 Assignment.

Private Attributes

vgl_point_2d< Type > point1_
 One end of line segment.
vgl_point_2d< Type > point2_
 The other end of the line segment.

Related Functions

(Note that these are not member functions.)

double vgl_distance (vgl_line_segment_2d< T > const &l, vgl_point_2d< T > const &p)
 Closest distance from a point p to a line segment l in 2D.
vcl_ostream & operator<< (vcl_ostream &s, const vgl_line_segment_2d< Type > &p)
 Write to stream.
vcl_istream & operator>> (vcl_istream &is, vgl_line_segment_2d< Type > &p)
 Read from stream.
bool vgl_lineseg_test_line (vgl_line_2d< T > const &l1, vgl_line_segment_2d< T > const &l2)
 true if the line meets the linesegment.
bool vgl_lineseg_test_lineseg (vgl_line_segment_2d< T > const &l1, vgl_line_segment_2d< T > const &l2)
 return true if the two linesegments meet.


Constructor & Destructor Documentation

template<class Type>
vgl_line_segment_2d< Type >::vgl_line_segment_2d  )  [inline]
 

Default constructor - does not initialise!.

Definition at line 32 of file vgl_line_segment_2d.h.

template<class Type>
vgl_line_segment_2d< Type >::vgl_line_segment_2d vgl_line_segment_2d< Type > const &  l  )  [inline]
 

Copy constructor.

Definition at line 35 of file vgl_line_segment_2d.h.

template<class Type>
vgl_line_segment_2d< Type >::vgl_line_segment_2d vgl_point_2d< Type > const &  p1,
vgl_point_2d< Type > const &  p2
[inline]
 

Construct from two end points.

Definition at line 39 of file vgl_line_segment_2d.h.

template<class Type>
vgl_line_segment_2d< Type >::~vgl_line_segment_2d  )  [inline]
 

Destructor.

Definition at line 44 of file vgl_line_segment_2d.h.


Member Function Documentation

template<class Type>
Type vgl_line_segment_2d< Type >::a  )  const
 

Parameter a of line a*x + b*y + c = 0.

Definition at line 25 of file vgl_line_segment_2d.txx.

template<class Type>
Type vgl_line_segment_2d< Type >::b  )  const
 

Parameter b of line a*x + b*y + c = 0.

Definition at line 31 of file vgl_line_segment_2d.txx.

template<class Type>
Type vgl_line_segment_2d< Type >::c  )  const
 

Parameter c of line a*x + b*y + c = 0.

Definition at line 37 of file vgl_line_segment_2d.txx.

template<class Type>
vgl_vector_2d< double > vgl_line_segment_2d< Type >::direction  )  const
 

unit vector describing line direction.

Definition at line 43 of file vgl_line_segment_2d.txx.

template<class Type>
vgl_vector_2d< double > vgl_line_segment_2d< Type >::normal  )  const
 

unit vector orthogonal to line.

Definition at line 50 of file vgl_line_segment_2d.txx.

template<class Type>
bool vgl_line_segment_2d< Type >::operator!= vgl_line_segment_2d< Type >const &  other  )  const [inline]
 

The inequality comparison operator.

Definition at line 58 of file vgl_line_segment_2d.h.

template<class Type>
bool vgl_line_segment_2d< Type >::operator== vgl_line_segment_2d< Type > const &  l  )  const [inline]
 

The equality comparison operator.

Definition at line 53 of file vgl_line_segment_2d.h.

template<class Type>
vgl_point_2d<Type> vgl_line_segment_2d< Type >::point1  )  const [inline]
 

One end-point of the line segment.

Definition at line 47 of file vgl_line_segment_2d.h.

template<class Type>
vgl_point_2d<Type> vgl_line_segment_2d< Type >::point2  )  const [inline]
 

The other end-point of the line segment.

Definition at line 50 of file vgl_line_segment_2d.h.

template<class Type>
void vgl_line_segment_2d< Type >::set vgl_point_2d< Type > const &  p1,
vgl_point_2d< Type > const &  p2
[inline]
 

Assignment.

Definition at line 86 of file vgl_line_segment_2d.h.

template<class Type>
double vgl_line_segment_2d< Type >::slope_degrees  )  const
 

angle with the oriented horizontal line y=0, measured in 360-degrees.

Returns values between -180 and 180.

Definition at line 57 of file vgl_line_segment_2d.txx.

template<class Type>
double vgl_line_segment_2d< Type >::slope_radians  )  const
 

angle with the oriented horizontal line y=0, measured in radians.

Returns values between -pi and pi.

Definition at line 72 of file vgl_line_segment_2d.txx.


Friends And Related Function Documentation

template<class Type>
vcl_ostream & operator<< vcl_ostream &  s,
const vgl_line_segment_2d< Type > &  p
[related]
 

Write to stream.

Definition at line 10 of file vgl_line_segment_2d.txx.

template<class Type>
vcl_istream & operator>> vcl_istream &  is,
vgl_line_segment_2d< Type > &  p
[related]
 

Read from stream.

Definition at line 16 of file vgl_line_segment_2d.txx.

template<class Type>
double vgl_distance vgl_line_segment_2d< T > const &  l,
vgl_point_2d< T > const &  p
[related]
 

Closest distance from a point p to a line segment l in 2D.

See also:
vgl_distance_to_linesegment()

vgl_distance2_to_linesegment()

Definition at line 309 of file vgl_distance.txx.

template<class Type>
bool vgl_lineseg_test_line vgl_line_2d< T > const &  l1,
vgl_line_segment_2d< T > const &  l2
[related]
 

true if the line meets the linesegment.

End points are considered to belong to a line segment.

Definition at line 35 of file vgl_lineseg_test.h.

template<class Type>
bool vgl_lineseg_test_lineseg vgl_line_segment_2d< T > const &  l1,
vgl_line_segment_2d< T > const &  l2
[related]
 

return true if the two linesegments meet.

End points are considered to belong to a line segment.

Definition at line 48 of file vgl_lineseg_test.h.


Member Data Documentation

template<class Type>
vgl_point_2d<Type> vgl_line_segment_2d< Type >::point1_ [private]
 

One end of line segment.

Definition at line 26 of file vgl_line_segment_2d.h.

template<class Type>
vgl_point_2d<Type> vgl_line_segment_2d< Type >::point2_ [private]
 

The other end of the line segment.

Definition at line 28 of file vgl_line_segment_2d.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 14:39:28 2008 for core/vgl by  doxygen 1.4.4