Definition
An instance ds of type DSegment is a line segment [p, q], where p and q are double points. We call p the source point and q the target point of the segment.
#include < AGD/DSegment.h >
Creation
DSegment | ds | creates an instance ds of type DSegment initialized to the segment [(0, 0),(0, 0)]. |
DSegment | ds(const DPoint& p, const DPoint& q) | |
creates an instance ds of type DSegment initialized to the segment [p, q]. |
Operations
const DPoint& | ds.source() | returns a reference to the source point of ds. |
const DPoint& | ds.target() | returns a reference to the target point of ds. |
bool | ds.horizontal() | returns true iff ds is horizontal, i.e the y-coordinate of the source point equals the y-coordinate of the target point. |
bool | ds.vertical() | returns true iff ds is vertical, i.e the x-coordinate of the source point equals the x-coordinate of the target point. |
© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13