navlib::Segment Class Reference

A line segment. More...

#include <geometry.h>

List of all members.

Public Member Functions

 Segment (double x1, double y1, double x2, double y2)
 Segment (Point p1, Point p2)
bool operator== (const Segment &segment) const
 Equals operator.
double getDistance (const Point &point) const
 Returns the distance to a point.
double getLength () const
 Returns the length of the line segment.
Point getPoint1 () const
 Accessor for the first point in the line segment.
Point getPoint2 () const
 Accessor for the second point in the line segment.
void setPoint1 (const Point &p)
 Accessor for the first point in the line segment.
void setPoint2 (const Point &p)
 Accessor for the second point in the line segment.


Detailed Description

A line segment.

Constructor & Destructor Documentation

Segment::Segment ( double  x1,
double  y1,
double  x2,
double  y2 
)

Parameters:
x1 x coordinate of the first point
y1 y coordinate of the first point
x2 x coordinate of the second point
y2 y coordinate of the second point

Segment::Segment ( Point  p1,
Point  p2 
)

Parameters:
p1 first point
p2 second point


The documentation for this class was generated from the following files:

Generated on Mon Nov 3 20:33:35 2008 for navlib by  doxygen 1.5.5