Tag: 计算几何

计算ruby中多边形的面积

我有一组代表多边形的纬度/经度坐标对。 我正在尝试确定该多边形内的总面积。 我将如何在Ruby中实现这一目标? 这是多边形的示例数组: [[37.7663613767094, -122.452969210084], [37.7674219449606, -122.444718340349], [37.7701838510542, -122.445330289514], [37.7709974013834, -122.439159589248], [37.7700761930893, -122.438861402472], [37.7703501163684, -122.436868738421], [37.7712650571321, -122.437078116573], [37.7736056746515, -122.437533130227], [37.7714671036087, -122.453964210266], [37.7663613767094, -122.452969210084]]

用于辐射计算的着色掩模算法

我正在研究一种软件(Ruby-Sketchup)来计算行人层面城市发展中的辐射(太阳,天空和周围建筑物)。 最终目标是能够创建一个显示总辐射水平的等高线图。 总辐射是指短波(光)和长波(热)。 (为了给你一个想法: http : //www.iaacblog.com/maa2011-2012-digitaltools/files/2012/01/Insolation-Analysis-All-Year.jpg ) 我知道有几个现有的软件可以做到这一点,但我需要自己编写,因为这个计算只是更复杂的工作流程的一部分。 (明显的)伪代码如下: Select and mesh surface for analysis From each point of the mesh Cast n (see below) rays in the upper hemisphere (precalculated) For each ray check whether it is in shade If in shade => Extract properties from intersected surface If not in shade => […]