简体   繁体   中英

How to find out the number of edges, faces, vertices in a polygon

Is there an easy way to find the number of edges, faces and vertices in a polygon (say decagon or hendecagon). Is this data available as part of a java library or should it be manually derived from the wiki data.

If you really do mean polygons rather than polyhedrons, then:

  • polygons don't have faces, and
  • the number of edges of a polygon is the same as the number of vertices.

If you want Java code to translate the name of a polygon to the number of edges or vertices, then a simple lookup table should cover all cases that you are likely to encounter. If that is not sufficient, then the problem is pretty much the same as the problem of translating ancient greek numbers (in anglicized form) into integers.

This page explains how to count in anglicized ancient greek and latin, but it fizzles out at around 20. At that point, you probably need to extemporize; ie make them up.

The page explain that usage beyond dodeca- is extremely rare (apart from icosahedron). However, I'm sure you could find a few loons out there who would love to waste hours of your timing debating the correct name for a 42 sided polygon.

Sounds like you may be fishing for Euler's result for connected graphs:

R + N = E + 2
ie regions + nodes = edges + 2

You can consider this a graph on the 2D plane.

However, you can also apply it equally to polyhedra: you could wrap your graph around a ball, and make the arcs straighten out, in which case you would want to think of 'faces' instead of 'regions'. Topologically it's the same thing.

I always need to do a quick check to see if I got that the right way round: A cube has 6 faces, 8 nodes, 12 edges. 6 + 8 = 12 + 2. Yep. Check. R + N = E + 2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM