如何用n梯形面板限制球体

发布于 2025-02-11 14:34:01 字数 105 浏览 0 评论 0原文

不确定这是在这里还是在数学交换上。

所以我有一个半径r的范围。我想在图块/面板中限制它,然后我可以用纬度和经度组织的现实世界中的数据填充。但是我坚持如何生成瓷砖。

谢谢

not sure if this belongs here or on the mathematics exchange.

So I have a sphere of radius r. I want to circumscribe it in tiles/ panels which I can then populate with data from the real world organized by latitude and longitude. But I'm stuck on how to generate the tiles.

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

゛时过境迁 2025-02-18 14:34:01

如果您将球形切成梯形,则球将分为环,然后在这些环之间绘制梯形。我在这里做了一个工作示例,显示生成的球体(请原谅,但是制作小提琴更容易)。 https://jsfiddle.net/uyrk1vb8/

点像这样计算了点,从-π计算了点/2至π/2,圆形圆形从0到2π不等。

function calculatePoint(ringAngle: number, circleAngle: number, radius: number): Point {
  const ringRadius = Math.cos(ringAngle) * radius;
  const x = Math.cos(circleAngle) * ringRadius;
  const y = Math.sin(circleAngle) * ringRadius;
  const z = Math.sin(ringAngle) * radius;
  return {x, y, z};
}

然后通过连接这些点来创建梯形。小提琴在函数计算中提供了一个示例。

If you are tessellating a sphere into trapezoids, the sphere is divided into rings and then trapezoids are drawn between those rings. I've made a working example here that displays the generated sphere (excuse the typescript, but it is easier to make fiddles). https://jsfiddle.net/uyrk1vb8/

The points are calculated like this, where ringAngle varies from -π/2 to π/2 and the circleAngle varies from 0 to 2π.

function calculatePoint(ringAngle: number, circleAngle: number, radius: number): Point {
  const ringRadius = Math.cos(ringAngle) * radius;
  const x = Math.cos(circleAngle) * ringRadius;
  const y = Math.sin(circleAngle) * ringRadius;
  const z = Math.sin(ringAngle) * radius;
  return {x, y, z};
}

Then trapezoids are created by connecting those points. The fiddle provides an example of this in the function calculateTrapezoid.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文