Inspired by this challenge, as well as a problem I've been working on
Problem:
Given a non-empty set of points in 3D
space, find the diameter of the smallest sphere that encloses them all. The problem is trivial if the number of points is three or fewer so, for the sake of this challenge, the number of points shall be greater than three.
Input: A list of 4 or more points, such that no three points are colinear and no four points are coplanar. Coordinates must be floats, and it is possible that two or more points may share a coordinate, although no two points will be the same.
Output: The diameter of the set (the diameter of the smallest sphere that encloses all points in the set), as a float. As has been pointed out, this is not necessarily the same as the largest distance between any two points in the set.
Rules:
You may assume that the points are not colinear.
The smallest program (in bytes) wins. Please include the language used, and the length in bytes as a header in the first line of your answer.
Example I/O:
Input:
[[4, 3, 6], [0, 2, 4], [3, 0, 4], [0, 9, 1]]
Output:
9.9498743710662
Input:
[[8, 6, 9], [2, 4, 5], [5, 5, 4], [5, 1, 6]]
Output:
7.524876236605994
[0,0,0],[1,0,0],[0,1,0],[0,0,1]
. \$\endgroup\$