 Boost :

Subject: Re: [boost] [geometry] area, length, centroid, behavior
From: Topher Cooper (topher_at_[hidden])
Date: 2009-02-24 19:43:18

I agree entirely with Brandon that this is a frequent way of defining
what a point is. I disagree that it is the only useful way of defining
a point. A point is equally the limit of a sequence of polygons as
their diameter shrinks to zero. There is nothing intrinsically,
mathematically (and certainly not practically) wrong with considering a
polyline as a special ("degenerate") case of a polygon, a line segment
as a special case of a polyline and thus of a polygon (or as a special
case of a polygon directly -- one whose "width" has reached the limit of
zero) or a point as a special case of a line segment. What /would /you
call a line
whose length happened to be zero?

The centroid is even more clear cut. It has always been a concept
defined for an arbitrary set of points, which includes lines, line
segments, polylines and individual points.

On the other hand, I would say that the "length" of a polygon is too
ambiguous -- some degeneracy needs to be available to disambiguate. Is
the "length" the perimeter, the minimum diameter, the maximum diameter,
the average diameter, or, as most developments of fractal geometry would
have it, an infinite length (the fractal dimensionality of a geometric
object is the dimension of the measure on that object is neither zero
nor infinite; by the way this would give a line or a point an area of
0)? I would go with an error here.

Use case:

I have a collection of objects in a 2-d space. Some do not have a
measurable extent so they are modeled as points. Some have a measurable
extent only in a single dimension so that are modeled as oriented line
segments. I want the centroid of the system. I also want the center of
mass where mass is proportional to substance, i.e., area. Here points
and line segments have an area of zero and hence a mass of zero. I
could handle this, of course, by adding code that extends the concept of
area so that by explicit test the area+ is equal to the area of a
polygon and equal to 0 for a line-segment a polyline or a point, but
that is just saying that the model is inadequate for this purpose and I
would need to write special code to extend it in this quite reasonable way.

If I go to the trouble of declaring things so that points and
line-segments and polylines and polygons can all be used "together" then
I probably want to treat them this way. If I don't, then I should have
to eliminate that case explicitly by testing -- just as I would if I
wanted to exclude the use of area of a concave or self-intersecting polygon.

Topher

Brandon Kohn wrote:
>
> I suppose this is just where I differ from everyone. A point is a
> 0-simplex. It has no units (dimensionless) in content space. A line
> segment is a 1-simplex. It has units of length in content space. The
> 2-simplex (triangle) has units of area. A 3-simplex has units of
> volume and so forth with increasing dimension. It doesn't make sense
> IMO to query the area of a point any more than it does to query the
> length or volume of a point. I cannot see a viable use-case for
> wanting it, and based on that I don't see why the developer would want
> to add additional code to support it.
>
> Brandon