In: Computer Science
[In Python] Write a program that takes a .txt file as input. This .txt file contains 10,000 points (i.e 10,000 lines) with three co-ordinates (x,y,z) each. From this input, use relevant libraries and compute the convex hull. Now, using all the points of the newly constructed convex hull, find the 50 points that are furthest away from each other, hence giving us an evenly distributed set of points.
Here above, each column represents a convex hull points and each row index also represent a complex hull point index.
Here below, I've sorted each column one by one and recorded highest distance and the coresponding index of the convex point from the row index and then shown the top 50 indices which can be fetched from 3 co-cordinate lists.
# get all the coordinates
all_coord = list()
for loop1 in range(len(top_max_values)):
all_coord.append((x_coord[loop1],y_coord[loop1],z_coord[loop1]))
all_coord[:7]
Plot of all the convex points:
Plot of 50 convex points: