计算表面包含4个点的球体中心(C#) [英] Calculate centre of sphere whose surface contains 4 points (C#)

查看:179
本文介绍了计算表面包含4个点的球体中心(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个名为MIConvexHull的3D Voronoi库,该库为3D空间中的一系列点计算3D Voronoi图.但是,它没有提供有关Voronoi图结构的高级信息.报告的边仅是坐标对列表,然后必须计算周长.

I am using a 3D Voronoi library called MIConvexHull, which calculates a 3D Voronoi diagram for a series of points in 3D space. However, it does not provide high-level information about the structure of the Voronoi diagram; the reported edges are simply a list of coordinate pairs which then have to have the circumcentre calculated.

现在,该库提供了一系列2D点的外接点计算的实现.如您在此处看到的,显示了起点(橙色)和终点(绿色)的坐标对:

Now the library provides an implementation of the circumcentre calculation for a series of 2D points. As you can see here, the coordinate pairs for the start (orange) and end (green) are shown:

您可以直观地看到,如果采用每个边缘中列出的顶点,然后制作一个圆,使该圆的周长接触所有边缘,则中心就是边缘的起点.

You can visually see that if you take the vertexes listed in each of the edges and you make a circle such that the circumference of that circle touches all of the edges, the centre is where the edge starts.

我遇到的问题是我的点是3D的,因此它不是返回圆的中心,而是球体的中心.不幸的是,高级数学并不是我的头脑真正能很好地处理的事情,因此我不知道如何解决这个问题.

The problem that I have is that my points are 3D and thus it won't be the centre of a circle that's returned, but the centre of a sphere. Unfortunately, advanced mathematics is not something that my head can really handle that well, so I have no idea how to approach this problem.

如何给定3D空间中的4个点,如何获得球体的中心,使所有点都位于球体的表面上?

在3D模式下,将提供4个点,而不是3个.

In 3D, there will be 4 points provided, not 3.

推荐答案

这是一个Javascript实现:

Here's a Javascript implementation:

http://www.convertalot.com/sphere_solver.html

以及一些数学解释:

http://steve.hollasch.net/cgindex/geometry/sphere4pts.html

通过将以下行列式设置为零,可以给出球体...的方程:

The equation of the sphere ... is given by setting the following determinant to zero:

| x^2  + y^2  + z^2   x   y   z   1 |
| x1^2 + y1^2 + z1^2  x1  y1  z1  1 |
| x2^2 + y2^2 + z2^2  x2  y2  z2  1 | = 0.
| x3^2 + y3^2 + z3^2  x3  y3  z3  1 |
| x4^2 + y4^2 + z4^2  x4  y4  z4  1 |

这篇关于计算表面包含4个点的球体中心(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆