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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14.14 Rational Circles ( rat circle )<br />

1. Definition<br />

An instance C of data type rat circle is an oriented circle in the plane. A circle is<br />

defined by three points p 1 , p 2 , p 3 with rational coordinates (rat points). <strong>The</strong> orientation<br />

of C is equal to the orientation of the three defining points, i.e., orientation(p 1 , p 2 , p 3 ).<br />

Positive orientation corresponds to counterclockwise orientation and negative orientation<br />

corresponds to clockwise orientation.<br />

Some triples of points are unsuitable for defining a circle. A triple is admissable if<br />

|{p 1 , p 2 , p 3 }| ≠ 2. Assume now that p 1 , p 2 , p 3 are admissable. If |{p 1 , p 2 , p 3 }| = 1 they<br />

define the circle with center p 1 and radius zero. If p 1 , p 2 , and p 3 are collinear C is a<br />

straight line passing through p 1 , p 2 and p 3 in this order and the center of C is undefined.<br />

If p 1 , p 2 , and p 3 are not collinear, C is the circle passing through them.<br />

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

2. Types<br />

rat circle :: coord type<br />

rat circle :: point type<br />

rat circle :: float type<br />

the coordinate type (rational).<br />

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

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

3. Creation<br />

rat circle C(const rat point& a, const rat point& b, const rat point& c);<br />

rat circle C(const rat point& a, const rat point& b);<br />

rat circle C(const rat point& a);<br />

introduces a variable C of type rat circle. C is initialized to<br />

the circle through points a, b, and c.<br />

Precondition: a, b, and c are admissable.<br />

introduces a variable C of type circle. C is initialized to<br />

the counter-clockwise oriented circle with center a passing<br />

through b.<br />

introduces a variable C of type circle. C is initialized to the<br />

trivial circle with center a.<br />

rat circle C;<br />

introduces a variable C of type rat circle. C is initialized to<br />

the trivial circle centered at (0, 0).

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

Saved successfully!

Ooh no, something went wrong!