31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

14.10 Rational Points ( rat point )<br />

1. Definition<br />

An instance of data type rat point is a point with rational coordinates in the twodimensional<br />

plane. A point with cartesian coordinates (a, b) is represented by homogeneous<br />

coordinates (x, y, w) of arbitrary length integers (see 5.1) such that a = x/w and<br />

b = y/w and w > 0.<br />

#include < <strong>LEDA</strong>/geo/rat point.h ><br />

2. Types<br />

rat point :: coord type<br />

rat point :: point type<br />

rat point :: float type<br />

the coordinate type (rational).<br />

the point type (rat point).<br />

the corresponding floating-point type (point).<br />

3. Creation<br />

rat point p;<br />

introduces a variable p of type rat point initialized to the point<br />

(0, 0).<br />

rat point p(const rational& a, const rational& b);<br />

introduces a variable p of type rat point initialized to the point<br />

(a, b).<br />

rat point p(integer a, integer b);<br />

introduces a variable p of type rat point initialized to the point<br />

(a, b).<br />

rat point p(integer x, integer y, integer w);<br />

introduces a variable p of type rat point initialized to the point<br />

with homogeneous coordinates (x, y, w) if w > 0 and to point<br />

(−x, −y, −w) if w < 0.<br />

Precondition: w ≠ 0.<br />

rat point p(const rat vector& v);<br />

introduces a variable p of type rat point initialized to the point<br />

(v[0], v[1]).<br />

Precondition: : v.dim( ) = 2.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!