18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

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.

Robust Geometric Primitives<br />

Incircle will return 0 if all four points are cocircular, a positive value if d is inside the circle, and<br />

negative if d is outside.<br />

Check out the implementations described below before you attempt to build your own.<br />

Implementations: LEDA (see Section ) provides a very complete set of geometric primitives for<br />

planar geometry, written in C++. If you are writing a significant geometric application, you should<br />

consider basing it on LEDA. At least check them out before you try to write your own.<br />

O'Rourke [O'R94] provides implementations in C of most of the primitives discussed in this section. See<br />

Section . <strong>The</strong>se primitives were implemented primarily for exposition rather than production use, but<br />

they should be quite reliable and might be more appropriate than LEDA for small applications.<br />

A robust implementation of the basic geometric primitives in C++ using exact arithmetic, by Jonathan<br />

Shewchuk, is available at http://www.cs.cmu.edu/ quake/robust.html. Don't expect them to be very<br />

fast.<br />

Pascal implementations of basic geometric primitives appear in [MS91]. Sedgewick [Sed92] provides<br />

fragments of the basic primitives in C++. See Section for both of them.<br />

An alternative C++ library of geometric algorithms and data structures (although you are almost certainly<br />

better off sticking to LEDA) is Geolab, written by Pedro J. de Rezende, Welson R. Jacometti, Cesar N.<br />

Gon, and Laerte F. Morgado, Universidade Estadual de Campinas, Brazil. Geolab requires the SUN C++<br />

compiler, but a Sparc binary and visualization environment is included along with all source code.<br />

Geolab appears to be primarily for the brave, since its robustness is uncertain and it contains little<br />

documentation, but it does provide 40 algorithms, including such advanced topics as farthest point<br />

Voronoi diagrams, nearest neighbor search, and ray shooting.<br />

Notes: O'Rourke [O'R94] provides an implementation-oriented introduction to computational geometry,<br />

which stresses robust geometric primitives and is recommended reading.<br />

Shewchuk [She96] and Fortune and van Wyk [FvW93] present careful studies on the costs of using<br />

arbitrary-precision arithmetic for geometric computation. By being careful about when to use it,<br />

reasonable efficiency can be maintained while achieving complete robustness. Other approaches to<br />

achieving robustness include [DS88, Hof89, Mil89].<br />

file:///E|/BOOK/BOOK4/NODE184.HTM (4 of 5) [19/1/2003 1:31:35]

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

Saved successfully!

Ooh no, something went wrong!