In [5]:
%reload_ext autoreload
%autoreload 2
In [6]:
from centerpoints.iterated_tverberg import IteratedTverberg
from centerpoints.iterated_radon import IteratedRadon
import centerpoints.cli as cli
import numpy as np
import math
from math import cos, sin, pi
In [7]:
it = IteratedTverberg()
cl = IteratedRadon()
cl2 = IteratedRadon(True)
In [8]:
import matplotlib
matplotlib.use('PDF')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
In [9]:
with open('./evaluation/sphere-3d-random-50-500.csv') as file:
s = cli.read_points_csv(file, '\t')
p = it.centerpoint(s)
p1 = cl.centerpoint(s)
p2 = cl2.centerpoint(s)
s = np.asarray(s)
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
ax.scatter(s[:,0],s[:,1],s[:,2], c='b', s=15)
ax.scatter(*p, s=25, c='red')
ax.scatter(*p1, s=25, c='yellow')
ax.scatter(*p2, s=25, c='orange')
fig.savefig('random_sphere.pdf')
In [ ]:
with open('./evaluation/sphere-3d-50-500.csv') as file:
s = cli.read_points_csv(file, '\t')
p = it.centerpoint(s)
p1 = cl.centerpoint(s)
p2 = cl2.centerpoint(s)
s = np.asarray(s)
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
ax.scatter(s[:,0],s[:,1],s[:,2], c='b', s=15)
ax.scatter(*p, s=25, c='red')
ax.scatter(*p1, s=25, c='yellow')
ax.scatter(*p2, s=25, c='orange')
fig.savefig('normal_sphere.pdf')
In [ ]:
with open('./evaluation/sphere-2d-50-500.csv') as file:
s = cli.read_points_csv(file, '\t')
p = it.centerpoint(s)
p1 = cl.centerpoint(s)
p2 = cl2.centerpoint(s)
s = np.asarray(s)
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
ax.scatter(s[:,0],s[:,1], c='b', s=15)
ax.scatter(*p, s=25, c='red')
ax.scatter(*p1, s=25, c='yellow')
ax.scatter(*p2, s=25, c='orange')
fig.savefig('ring.pdf')