- Main Page
- Modules
- Classes

- Class List
- Class Hierarchy
- Class Members

# IpeSegment Class Reference
[Ipe Geometry]

A directed line segment. More...

List of all members.

## Public Member Functions

- IpeSegment ()
- IpeSegment (const IpeVector &p, const IpeVector &q)
- IpeLine Line () const
- double Distance (const IpeVector &v, double bound) const
- double Distance (const IpeVector &v) const
- bool Project (const IpeVector &v, IpeVector &projection) const
- bool Intersects (const IpeSegment &seg, IpeVector &pt) const
- bool Intersects (const IpeLine &l, IpeVector &pt) const
- bool snap (const IpeVector &mouse, IpeVector &pos, double &bound) const

## Public Attributes

- IpeVector iP
- IpeVector iQ

## Detailed Description

A directed line segment.

## Constructor & Destructor Documentation

IpeSegment::IpeSegment | ( |  | ) | `[inline]`

Create uninitialized segment.

## Member Function Documentation

IpeLine IpeSegment::Line | ( |  | ) | const`[inline]`

Return directed line supporting the segment.

double IpeSegment::Distance | ( | const IpeVector & | v,
|  | double | bound |
| ) |  |  | const

Returns distance between segment and point v, but may just return bound when its larger than bound.

double IpeSegment::Distance | ( | const IpeVector & | v | ) | const

Returns distance between segment and point v

bool IpeSegment::Project | ( | const IpeVector & | v,
|  | IpeVector & | projection |
| ) |  |  | const

Project point v orthogonally on segment. Returns false if the point falls outside the segment.

bool IpeSegment::Intersects | ( | const IpeSegment & | seg,
|  | IpeVector & | pt |
| ) |  |  | const

Compute intersection point. Return `false` if segs don't intersect.

bool IpeSegment::Intersects | ( | const IpeLine & | l,
|  | IpeVector & | pt |
| ) |  |  | const

Compute intersection point. Return `false` if no intersection.

bool IpeSegment::snap | ( | const IpeVector & | mouse,
|  | IpeVector & | pos,
|  | double & | bound |
| ) |  |  | const

Snap mouse position to this segment.

If distance between mouse and the segment is less than bound, then set pos to the point on the segment, bound to the distance, and return true.

## Member Data Documentation

IpeVector IpeSegment::iP

First endpoint.

IpeVector IpeSegment::iQ

Second endpoint.

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

- ipegeo.h
- ipegeo.cpp