Boost logo

Boost :

Subject: Re: [boost] Preview 3 of the Geometry Library
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2008-10-21 21:20:38


John Phillips wrote:

> Every coordinate system was created for algebra, calculus and
> computations.

Yet when dealing with vectors and matrices, I'm pretty sure the
cartesian coordinate system is what everyone uses.

> Making the best choice of coordinates for a representation
> can speed calculations by orders of magnitude, or even in some cases
> make problems solvable that weren't in Cartesian coordinates (because of
> a lack of an appropriate representation for the solution). This is a
> huge deal in analytic calculations (See, for example the books by Morse
> and Feshback, or the early editions of Arfken where chapters are
> dedicated to finding and operating in the best coordinate system for the
> job. Also see facilities for this work in Maple or Mathematica.), but it
> is a sometimes under appreciated aspect of numeric calculation, as well.

I've heard that various analytical problems are much more easily
represented in other coordinates. But is really the kind of problems you
want a boost geometry library to deal with?

Apart from that, I've seen people use homogeneous coordinates (which are
very similar to cartesian) to avoid doing some divisions that might lead
to numerical instability.
That should be an easy addition.

> This is a conceptually similar problem to the discussions about unit
> systems from a couple of years ago. High accuracy and high performance
> calculations can't afford to have hidden conversion costs in computation
> and precision imposed on them. A well designed library should make such
> hidden conversions possible for those who want them, while also not
> making them mandatory for those who can't afford to pay for them.

I thought it was better for simplicity, dealing with different
geometries seems hard enough, but a prerequisite of the library since it
aims at dealing with GIS; and hopefully, there won't be too many
geometries to handle.
On the other hand, different representations of points in the same space
are all equivalent, and one representation is enough to describe
everything we want to deal with, even if not in the most precise way.

The problem is that it seems hard for algorithms to consider all the
possibilities in existence for the points they're dealing with to be
represented and select the right way to compute something accordingly.
Latitude/Longitude seems close enough to cartesian so I supposed that a
lot of code can be shared.

Maybe only doing vector operations and generalizing to any orthogonal
coordinate system is possible without much hassle by working with
normalized basis vectors, but wouldn't that be quite similar to
converting to cartesian everytime?
I honestly have zero knowledge of non-cartesian coordinates, so I have
no knowledge of the vector theory behind it (and I have no knowledge of
how vectors apply to alternative geometries either).
Maybe that could somehow also be applied to help dealing with other
geometries that are locally euclidian?

If there are ways to write algorithms generically in a
coordinate-system-independent way, and maybe even geometry-independent
way, then it would be great, for sure.
But is that really possible?


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