# Path: pomp/klampt/vectorops.py
# def add(*items):
# def madd(a,b,c):
# def sub(a,b):
# def mul(a,b):
# def div(a,b):
# def maximum(a,b):
# def minimum(a,b):
# def dot(a,b):
# def normSquared(a):
# def norm(a):
# def unit(a,epsilon=1e-5):
# def norm_L1(a):
# def norm_Linf(a):
# def distanceSquared(a,b):
# def distance(a,b):
# def cross(a,b):
# def interpolate(a,b,u):


import random
from ..klampt import vectorops

def sample_hypersphere(d,c,r):
    """Samples a d-dimensional sphere uniformly, centered at c and with
    radius r"""
    assert(d == len(c))
    d = [random.gauss(0,1) for ci in c]
    d = vectorops.unit(d)

# Path: pomp/klampt/vectorops.py
# def add(*items):
# def madd(a,b,c):
# def sub(a,b):
# def mul(a,b):
# def div(a,b):
# def maximum(a,b):
# def minimum(a,b):
# def dot(a,b):
# def normSquared(a):
# def norm(a):
# def unit(a,epsilon=1e-5):
# def norm_L1(a):
# def norm_Linf(a):
# def distanceSquared(a,b):
# def distance(a,b):
# def cross(a,b):
# def interpolate(a,b,u):


# Path: pomp/spaces/sampling.py
import random
from ..klampt import vectorops


def sample_hypersphere(d,c,r):
    """Samples a d-dimensional sphere uniformly, centered at c and with
    radius r"""
    assert(d == len(c))
    d = [random.gauss(0,1) for ci in c]
    d = vectorops.unit(d)

    return vectorops.madd(c,d,r)