Boost logo

Boost :

Subject: Re: [boost] [geometry] area, length, centroid, behavior
From: Brandon Kohn (blkohn_at_[hidden])
Date: 2009-02-24 14:13:25


--------------------------------------------------
From: "Sebastian Redl" <sebastian.redl_at_[hidden]>
> It's a matter of interpretation. If you consider a point a 0-dimensional
> object placed in the n-dimensional space you're working with, it doesn't
> have an extent over any number of dimensions. If, however, you consider
> it an n-dimensional object with an extent of 0 along every dimension, it
> does have length, area, volume, and whatever you want to call
> hyper-volumes in more than 3 dimensions, all of them being 0.
>

I agree that you can interpret these things as you have stated. The part
that I find hard to accept is that I should somewhere in the code want:

point a;
line b;
....
 //! Assuming the "dimensionally agnostic" function for the 'area' metric is
called content.
double aArea = content( a );
double bArea = content( b );

My intuition tells me that such a call is far more likely to be a
logic-error than the case that I really want to know the area of a point or
line. So if I were defining the interface I would make the choice that I
have advocated. Of course the world won't end if zero area is returned for
points, lines (or type void for that matter.)

Brandon
 


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