def project_to_sphere(points, center, radius):
 lengths = scipy.spatial.distance.cdist(points, np.array([center]))
 return ((((points - center) / lengths) * radius) + center)

def project_to_sphere ( points , center , radius ) : lengths = scipy . spatial . distance . cdist ( points , np . array ( [ center ] ) ) return ( ( ( ( points - center ) / lengths ) * radius ) + center )
projects the elements of points onto the sphere defined by center and radius .