Boost logo

Boost :

Subject: Re: [boost] Preview 3 of the Geometry Library
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2008-10-22 11:35:23


John Phillips wrote:

> Some problems are simplified incredibly by a good choice of coordinate
> system. As a trivial example, consider a circle in two dimensional
> coordinates. There is no properly defined function in Cartesian
> coordinates that produces a circle. (There is a relation, but a circle
> is not single valued in Cartesian coordinates, and so can't be written
> as a function.) The function in plane polar coordinates is r = c (The
> radius equals a constant), when talking about a circle of radius c
> centered at the origin. This is a function, and a particularly simple one.

That seems only useful if you define your geometric objects as functions
on coordinates.

The geometry library doesn't take this analytical approach at all, since
it provides a finite set of basic geometric objects.

Basically, points, lines, segments, circles (which are really
hyperspheres) and polygons are all you have to describe shapes with this
library.
I suppose it should be extended to also include half-lines, planes,
half-planes, half-spaces, hyperplanes, etc. Adding the ability to
construct objects from the union/intersection/difference of other
objects could also be useful.

Those objects are not even defined in terms of functions or not even
equations upon their coordinates, but with more practical relations
around points.
For example, a circle is defined as the set of points that are at equal
distance to some other point. A circle is thus represented as a point
plus a distance.
A polygon with no hole is the space which is inside a closed path of
points. It is thus represented as a sequence of points in some specific
order.

Whether the points use one or another coordinate system has no
consequences on the way the set of points is represented.
The algorithms, however, will perform computations on those points, and
thus require some proprieties on them. Orthonormal coordinates give a
well-known framework to code in.

The point is, I don't say what gain you can have by allowing other
coordinate systems, since it will not allow easier expressions of shapes
or problems in that library.

Maybe working with other coordinate systems would be more the job of a
different library dedicated to differential geometry, than of this
library which only cares about simple basic and mostly discrete shapes.
To clarify, this library should maybe be called computational geometry.

The scope of the library is actually fairly close to the description at
wikipedia: <http://en.wikipedia.org/wiki/Computational_geometry>

I don't even know how one could define a polygon as a function in any
coordinate system, by the way.
As for your circle example, it only works if the center is at the
origin, so how do you generalize it without parameterizing?

By the way, in case you haven't noticed, I have zero differential
geometry knowledge, so I barely understand most of what you've been
saying ;).


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk