PolarSphere
computes an approximation to the unit sphere using a rectangular
grid in the polar angle space.
PolarBall
uses a partition of the polar sphere and joins those simplices to
the origin to approximately partition the unit ball.
LpNorm
computes the l^p norm of each columns of x
.
Polar2Rectangular
and Rectangular2Polar
convert between the polar coordinate
representation (r,theta[1],...,theta[n-1]) and the rectangular coordinates (x[1],...,x[n]).
n dimensional polar coordinates are given by the following:
rectangular x=(x[1],...,x[n]) corresponds to
polar (r,theta[1],...,theta[n-1]) by
x[1] = r*cos(theta[1])
x[2] = r*sin(theta[1])*cos(theta[2])
x[3] = r*sin(theta[1])*sin(theta[2])*cos(theta[3])
...
x[n-1]= r*sin(theta[1])*sin(theta[2])*...*sin(theta[n-2])*cos(theta[n-1])
x[n] = r*sin(theta[1])*sin(theta[2])*...*sin(theta[n-2])*sin(theta[n-1])
Here theta[1],...,theta[n-2] in [0,pi), and theta[n-1] in [0,2*pi).
This is the parameterization described in the Wikipedia webpage for "n-sphere".
Note that this is NOT a 1-1 transformation: when theta[1]=0, it follows
that x[2]=x[3]=...=x[n]=0. This is analagous to all longitude lines going
through the north pole in standard 3d spherical coordinates.
For multivariate integration, the Jacobian of the above tranformation
is J(theta) = r^(n-1) * prod( sin(theta[1:(n-2)])^((n-2):1) );
note that theta[n-1] does not appear in the Jacobian.