next up previous contents index
Next: Integer Polylines ( IPolyline Up: Simple Geometry Previous: Integer Points ( IPoint   Contents   Index


Integer Line Segments ( ISegment )

Definition

An instance is of type ISegment is a line segment [p, q], where p and q are integer points. We call p the source point and q the target point of the segment.

#include < AGD/ISegment.h >

Creation

ISegment is creates an instance is of type ISegment initialized to the segment [(0, 0),(0, 0)].

ISegment is(const IPoint& p, const IPoint& q)
    creates an instance is of type ISegment initialized to the segment [p, q].

Operations

const IPoint& is.source() returns a reference to the source point of is.

const IPoint& is.target() returns a reference to the target point of is.

bool is.horizontal() returns true iff is is horizontal, i.e the y-coordinate of the source point equals the y-coordinate of the target point.

bool is.vertical() returns true iff is is vertical, i.e the x-coordinate of the source point equals the x-coordinate of the target point.


next up previous contents index
Next: Integer Polylines ( IPolyline Up: Simple Geometry Previous: Integer Points ( IPoint   Contents   Index

© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13