#include <geometry.h>
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. | |
| Segment::Segment | ( | double | x1, | |
| double | y1, | |||
| double | x2, | |||
| double | y2 | |||
| ) |
| 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 |
1.5.5