Thanks for any helpful answers!
import numpy as np
from scipy.spatial import SphericalVoronoi
def sphere_points(n, dim):
points = np.random.randn(n, dim)
points /= np.linalg.norm(points, axis=1).reshape(-1, 1)
sv = SphericalVoronoi(points)
return sv.vertices
points = sphere_points(360, 10)ype here
I tried above code, but points variable gives dimension of (16041607, 10) unlike (360,10)
import numpy as np
from numpy.linalg import norm
import random
def sample_spherical(npoints, ndim):
vec = np.random.randn(ndim, npoints)
vec /= np.linalg.norm(vec, axis=0)
return vec
points = sample_spherical(360, 10)
This one gives 360 randomly distributed points on a 10-dimensional sphere. I am expecting 360 fixed points uniformly distributed on the 10-dimensional sphere of unit radius ex. randomly generating points on the sphere