Ipelib

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ipe::Line Class Reference
Ipe Geometry

`#include <ipegeo.h>`

## Public Member Functions
| Line ()
| Line (const Vector &p, const Vector &dir)
double | side (const Vector &p) const
Vector | normal () const
double | distance (const Vector &v) const
bool | intersects (const Line &line, Vector &pt)
Vector | project (const Vector &v) const
Vector | dir () const

## Static Public Member Functions
static Line | through (const Vector &p, const Vector &q)

## Public Attributes
Vector | iP

## Detailed Description

A directed line.

## Constructor & Destructor Documentation

## ◆ Line() [1/2]

ipe::Line::Line | ( |  | ) |
| inline explicit

Create default line (x-axis).

## ◆ Line() [2/2]

Line::Line | ( | const Vector & | p,
|  | const Vector & | dir
| ) |  |
| explicit

Construct a line from p with direction dir.

Asserts unit length of dir.

References ipe::Vector::sqLen().

## Member Function Documentation

## ◆ through()

Line Line::through | ( | const Vector & | p,
|  | const Vector & | q
| ) |  |
| static

Construct a line through two points.

Referenced by ipe::Bezier::straight().

## ◆ side()

double Line::side | ( | const Vector & | p | ) | const

Result is > 0, = 0, < 0 if point lies to the left, on, to the right.

Referenced by ipe::Bezier::intersect().

## ◆ normal()

Vector ipe::Line::normal | ( |  | ) | const
| inline

Return a normal vector pointing to the left of the directed line.

## ◆ distance()

double Line::distance | ( | const Vector & | v | ) | const

Returns distance between line and v.

References dir(), iP, ipe::Vector::len(), ipe::Vector::x, and ipe::Vector::y.

Referenced by ipe::Bezier::straight().

## ◆ intersects()

bool Line::intersects | ( | const Line & | line,
|  | Vector & | pt
| ) |  |

Does this line intersect line? If so, computes intersection point.

Referenced by ipe::Snap::snap().

## ◆ project()

Vector Line::project | ( | const Vector & | v | ) | const

Orthogonally project point v onto the line.

Referenced by ipe::Snap::setEdge(), and ipe::Snap::snap().

## ◆ dir()

Vector ipe::Line::dir | ( |  | ) | const
| inline

Return direction of line.

Referenced by distance(), ipe::Arc::intersect(), and ipe::Snap::setEdge().

## Member Data Documentation

## ◆ iP

Vector ipe::Line::iP

Point on the line.

Referenced by distance(), and ipe::Arc::intersect().

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

- ipegeo.h
- ipegeo.cpp