Message Boards Message Boards

[✓] Find the smallest circumsphere containing N points?

GROUPS:

How to draw the smallest Circumsphere containing N points?

POSTED BY: Nan Yang
Answer
4 months ago

Something like this?

M = 10; (*Number of points*)
data = RandomReal[1, {M, 2}]; (*Generate coords of points*)
Show[RegionPlot[BoundingRegion[data, "MinDisk"]], Graphics[{Red, Point /@ data}]] (*Calculate Circumdisk and plot*)

enter image description here

In 3D

data3d = RandomReal[1, {M, 3}];
Show[RegionPlot3D[BoundingRegion[data3d, "MinBall"], PlotStyle -> Directive[Yellow, Opacity[0.5]]], Graphics3D[{Red, Point /@ data3d}]]

enter image description here

Cheers,

Marco

POSTED BY: Marco Thiel
Answer
4 months ago

Thank you so much! But my version is 10.2, so it seems that the "BoundingRegion" cannot work. Do you know how to do with 10.2?

cheers, YN

POSTED BY: Nan Yang
Answer
3 months ago

Group Abstract Group Abstract