## Volume of polytopes

Higher-dimensional geometry (previously "Polyshapes").

### Volume of polytopes

I've found a neat way to calculate area and volume. First note that a triangle's area is half that of a parallelogram determined by two of its edges, and the parallelogram's (directed) area is the wedge product of those two edges. So a triangle has

A = (1/2) (v2 - v1) ^ (v3 - v1)
= (1/2) (v2^v3 + v3^v1 + v1^v2)

where vi are the vertices. A general n-gon can be broken into triangles sharing a vertex v1, so the total area is

A = (1/2) (v1^v2 + v2^v3 + v3^v1)
+ (1/2) (v1^v3 + v3^v4 + v4^v1)
+ (1/2) (v1^v4 + v4^v5 + v5^v1)
+ ...
+ (1/2) (v1^vn-1 + vn-1^vn + vn^v1)

= (1/2) (v1^v2 + v2^v3 + v3^v4 + ... + vn-1^vn + vn^v1),

a cyclic sum of wedge products of connected pairs of vertices. We could also write this as

A = (1/2) (v1^(v2 - v1) + v2^(v3 - v2) + ... + vn^(v1 - vn))
= (1/2) (x1^Δx1 + x2^Δx2 + ... + xn^Δxn)

which resembles an integral of the position vector x. Indeed, this is related to the fundamental theorem of geometric calculus. (That's int (∇F)~ dmx = int F~ dm-1x, where the integral on the left is over an m-dimensional region with tangent blade dmx, the integral on the right is over its boundary, and F~ is the reverse of a multivector function F.) In 2 dimensions, ∇x = 2, so we can convert the integral of 1 = (1/2)∇x, over the region's area, into an integral over the boundary curve:

A = int 1 d2x = (1/2) int x dx = (1/2) int x ^ dx.

The last equality is because the integral must be a bivector (no scalar part). More generally, we can use ∇x = m to find a region's (hyper)volume:

V = int 1 dmx = (1/m) int x dm-1x = (1/m) int x ^ dm-1x.

Along one facet F of an m-polytope, the tangent blade dm-1x is constant, and x ^ dm-1x is constant because x is varying parallel to dm-1x, so we can take this to be v1 ^ dm-1x, with v1 a vertex of F. So this part of the integral is

(1/m) intF x ^ dm-1x = (1/m) v1 ^ intF dm-1x

(and V is the sum of these integrals over all facets). But this term on the right is the directed volume of F, so we can calculate higher-dimensional volume recursively from lower dimensions.

Of course, if you want a scalar volume, then you need to take the magnitude of the multivector: ||V|| = sqrt{ V~ V } = sqrt{ | V V | }. But we need the direction of V in order to use the recursive formula.
Last edited by mr_e_man on Mon Aug 19, 2019 8:24 pm, edited 2 times in total.
mr_e_man
Trionian

Posts: 106
Joined: Tue Sep 18, 2018 4:10 am

### Re: Volume of polytopes

A tetrahedron's volume is 1/6 the volume of a corresponding parallelepiped, which is

V = (1/6) (v2 - v1) ^ (v3 - v1) ^ (v4 - v1)
= (1/6) (v2^v3^v4 - v1^v2^v3 + v1^v2^v4 - v1^v3^v4).

The above process gives the same result:

V = (1/3) v1 ^ intF132 d2x
+ (1/3) v1 ^ intF124 d2x
+ (1/3) v1 ^ intF143 d2x
+ (1/3) v2 ^ intF234 d2x

= (1/3) v1 ^ ( (1/2) (v1^v3 + v3^v2 + v2^v1 )
+ (1/3) v1 ^ ( (1/2) (v1^v2 + v2^v4 + v4^v1 )
+ (1/3) v1 ^ ( (1/2) (v1^v4 + v4^v3 + v3^v1 )
+ (1/3) v2 ^ ( (1/2) (v2^v3 + v3^v4 + v4^v2 )

= (1/6) (-v1^v2^v3 + v1^v2^v4 - v1^v3^v4 + v2^v3^v4).
mr_e_man
Trionian

Posts: 106
Joined: Tue Sep 18, 2018 4:10 am

### Re: Volume of polytopes

Essentially, we're just breaking up the polytope into pyramids with apex at the origin. The volume of an m-dimensional pyramid is (1/m) (height) (base volume). The height is measured perpendicular to the base, but we don't need to calculate this directly; the wedge product automatically discards any parallel component.

Here's an illustration of the "cyclic sum" formula. (The red and blue areas have opposite orientations, so they cancel out.) (This formula can be used to define the area of a skew polygon, even though it doesn't have an interior. Self-intersecting polygons are also allowed: the "hourglass" quadrilateral, for example, has 0 directed area.)
Attachments polygonArea.png (25.93 KiB) Viewed 812 times
mr_e_man
Trionian

Posts: 106
Joined: Tue Sep 18, 2018 4:10 am

### Re: Volume of polytopes

Ah! I see Mathologer made a video on this.

mr_e_man
Trionian

Posts: 106
Joined: Tue Sep 18, 2018 4:10 am

### Re: Volume of polytopes

It is even more interesting in this construction, in that it reveals the meaning of 'vector area' in any dimensions.

The construction given here is that $$V = \xi S = \int \vec x \cdot d\vec{s}$$, which means the total of the normal vectors $$\int d\vec{s} = 0$$.

If we were to divide a surface by a boundary, the boundary functions as a limit for a 'vector area' as the two halves add to 0. But we can replace one half by any other surface that bounds this ring, and the total of the two halves are still 0. That means, that if you create a surface bounded by a closed N-2 space, it has a definite vector-size $$\vec A = \int d \vec{s}$$ over the surface. This is the sort of stuff they teach you in the magnetic moment $$\vec m = I \vec A$$.

This means that a closed N-2 space has a definite 'circulation', and an 'up' and 'down' side. You can see how this works, first by imagining that clockwise surfaces point 'up'. When two clockwise surfaces are placed edge to edge, the current flows around the parimeter, and not down the common edge. And so on. Until a complete 'clockwise' polytope is made. If two clockwise polytopes are brought face to face, the circulation on the common face disappears, and the circulation now is around the joint surface. And this continues as cellss are added.

The circulation of an open set of face-plates (ie N-1 elements), is then a vector-area of any surface (N-1)-fabric, bounded by the exposed N-2 elements (ie a ring).
The dream you dream alone is only a dream
the dream we dream together is reality.

$$\LaTeX\$$ at https://greasyfork.org/en/users/188714-wendy-krieger wendy
Pentonian

Posts: 1925
Joined: Tue Jan 18, 2005 12:42 pm
Location: Brisbane, Australia

### Re: Volume of polytopes

And here's another video:

To describe face directions, he uses normal vectors, where I use tangent bivectors. These descriptions are "dual" to each other.
mr_e_man
Trionian

Posts: 106
Joined: Tue Sep 18, 2018 4:10 am 