Boost logo

Geometry :

Subject: [ggl] geometry::perimeter
From: Adam Wulkiewicz (adam.wulkiewicz)
Date: 2011-03-23 08:36:32

barend wrote:
> Hi Adam,
>> I noticed that geometry::perimeter returns 0 for 2d boxes. Moreover it's
>> not implemented for higher dimensions.
>> This kind of function calculating hypersurface of a geometry could be
>> usefull. I'll implement my own for now (for boxes).
> Good catch, will do that (for 2d) or, if your version is generic you can send a patch.

To be honest, there should be at least 3 functions:

perimeter - calculate sum of all edges lengths (for arbirary dimension
(for 1 it's equal to segment's length), or for dimension >= 2)

surface - sum of all faces' surfaces (dimension >= 2(for 2 it's equal to
area), or for dimension >= 3)

something which is called margin but it's not the best name IMO -
n-dimensional perimeter/surface/... generalization - for 2d it's 1d
value of perimeter, for 3d it's 2d value of surface, for 4d it should be
3d value of volumetric 4d hyper-faces, and so on...

> All these things might come but we currently concentrate on the Release, having names that fit into this scheme already.

Yes, of course.


Geometry list run by mateusz at