简体   繁体   English

如何找出多边形中的边,面,顶点的数量

[英]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. 此数据是否可以作为Java库的一部分使用,还是应该从Wiki数据手动获得?

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. 如果希望Java代码将多边形的名称转换为边数或顶点数,则简单的查找表应涵盖您可能遇到的所有情况。 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; 本页说明了如何计算古希腊化和拉丁化的语言,但最终在20个左右失误。 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. 不过,我相信你能找到一些潜鸟在那里谁愿意浪费你的时间为42边形辩论的正确名称的时间。

Sounds like you may be fishing for Euler's result for connected graphs: 听起来您可能正在寻找连接图的Euler结果:

R + N = E + 2 R + N = E + 2
ie regions + nodes = edges + 2 即区域+节点=边+ 2

You can consider this a graph on the 2D plane. 您可以将其视为2D平面上的图形。

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个边。 6 + 8 = 12 + 2. Yep. 6 + 8 = 12 + 2。 Check. 校验。 R + N = E + 2 R + N = E + 2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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