Main Page | Namespace List | Class List | File List | Namespace Members | Class Members

grid::Line Struct Reference

A class representing a line as two end points. More...

#include <grid.hh>

List of all members.

Public Member Functions

 Line ()
 Create a line.

 Line (Point a, Point b)
 Create a line.

 Line (float x1, float y1, float x2, float y2)
 Create a line.

 Line (const LineRT &line)
 Create a line by converting from the polar representation (rho, theta).

Point normal () const
 Compute the normal of the line.

Point tangent () const
 Compute the tangent of the line.

Point intersection (const Line &line) const
 Compute the intersection with line.

Linecut (const Line &line1, const Line &line2)
 Cut the line between two lines.

Line get_cut (const Line &line1, const Line &line2) const
 Compute the cut of the line between two lines.

Point closest (const Point &point) const
 Compute the point on the line that is closest to point.

Point mirror (const Point &point) const
 Mirror a point with respect to the line.

Linemirror (const Line &mirror)
 Mirror the line with respect to the given line.

Line get_mirror (const Line &mirror) const
 Return the line mirrored with respect to the given line.


Public Attributes

Point a
 The first end point.

Point b
 The second end point.


Detailed Description

A class representing a line as two end points.


Constructor & Destructor Documentation

grid::Line::Line Point  a,
Point  b
[inline]
 

Create a line.

Parameters:
a = the first end point
b = the second end point

grid::Line::Line float  x1,
float  y1,
float  x2,
float  y2
[inline]
 

Create a line.

Parameters:
x1 = the first end point
y1 = the first end point
x2 = the second end point
y2 = the second end point

grid::Line::Line const LineRT line  )  [inline]
 

Create a line by converting from the polar representation (rho, theta).

Note:
The end points of the resulting line are guaranteed to be on the line, but consider the actual positions to be arbitrary.


Member Function Documentation

Point grid::Line::closest const Point point  )  const [inline]
 

Compute the point on the line that is closest to point.

Parameters:
point = the point
Returns:
the point closest to point

Line& grid::Line::cut const Line line1,
const Line line2
[inline]
 

Cut the line between two lines.

Warning:
Consider the direction of the resulting line arbitrary.
Parameters:
line1 = the first line
line2 = the second line

Line grid::Line::get_cut const Line line1,
const Line line2
const [inline]
 

Compute the cut of the line between two lines.

Warning:
The direction of the resulting line is undefined.
Parameters:
line1 = the first line
line2 = the second line

Line grid::Line::get_mirror const Line mirror  )  const [inline]
 

Return the line mirrored with respect to the given line.

Parameters:
mirror = the mirror line

Point grid::Line::intersection const Line line  )  const [inline]
 

Compute the intersection with line.

Parameters:
line = the line to intersect with
Returns:
the intersection point

Line& grid::Line::mirror const Line mirror  )  [inline]
 

Mirror the line with respect to the given line.

Parameters:
mirror = the mirror line

Point grid::Line::mirror const Point point  )  const [inline]
 

Mirror a point with respect to the line.

Parameters:
point = point to mirror

Point grid::Line::normal  )  const [inline]
 

Compute the normal of the line.

Note that the length of the normal is not normalized to one.

Returns:
the normal of the line

Point grid::Line::tangent  )  const [inline]
 

Compute the tangent of the line.

Note that the length of the tangent is not normalized to one.

Returns:
the tangent of the line


The documentation for this struct was generated from the following file:
Generated on Wed Feb 16 08:42:26 2005 for Gocam by doxygen 1.3.4