Given N points in a 3D space, how to find the smallest sphere that contains these N points?

后端 未结 3 1061
广开言路
广开言路 2021-02-06 17:07

Given N points in a 3D space, how to find the smallest sphere that contains these N points?

3条回答
  •  无人共我
    2021-02-06 18:11

    There are several algorithms and implementations out there for this problem.

    • For 2D and 3D, Gärtner's implementation is probably the fastest.

    • For higher dimensions (up to 10,000, say), take a look at https://github.com/hbf/miniball, which is the implementation of an algorithm by Gärtner, Kutz, and Fischer (note: I am one of the co-authors).

    • For very, very high dimensions, core-set (approximation) algorithms will be faster.

    Note: If you are looking for an algorithm to compute the smallest enclosing sphere of spheres, you will find a C++ implementation in the Computational Geometry Algorithms Library (CGAL). (You do not need to use all of CGAL; simply extract the required header and source files.)

提交回复
热议问题