INTRODUCTION
Let S^{n} be an nhypersphere, or nsphere for short, of radius r in ndimensional euclidian space, that is:
The volume V_{n} and surface area A_{n} for the hypersphere are well known:
and
where, Γ is the gamma function. These formulas are short and clear. But
for a portion of a hypersphere, such as hyperspherical caps or sectors, there
is a need for concise and simple formulas. Applications of hypershperical caps
are found in spherical distributions (Ruymgaart, 1989),
stochastic optimizations (Bohachevsky et al., 1992;
Hughes, 2008) and information technology (Shen
et al., 2005), etc. Most of the related formulas are in the form
of complex finite series, recurrence or integrals.
Table 1: 
Beta and regularized incomplete beta functions in special
cases 

For instance, Jacquelin (2003) gave volume formulas
for a sector and cap using finite series for even and odd n separately. Chen
and He (2008) derived volume formulas in the similar form. In addition to
the volume formula, they also provided a surface area formula for a hyperspherical
cap. Hughes (2008) used Jacquelin’s hypersector
volume formula to deduce a cap area formula in the same series form. In Ericson
and Zinoviev (2001) and Cox et al. (2001, 2007),
recursive formulas are given for the cap surface area. These formulas are lengthy
and cumbersome in mathematical expression and hard to understand and interpret.
In this note, simple formulas in closedforms are given and appliable to any
integer n, either odd or even. These formulas are based on the widely used gamma
function and incomplete beta functions.
In this note, 0≤φ≤π/2 denotes the colatitude angle, i.e., the angle between a vector of the sphere and its positive n^{th}axis. The integral of sin^{n}θ will be used for the derivation. One identity with the integral is given here:
where, B(α, β) is the beta function, B(x; α, β) is the incomplete beta function and is the regularized incomplete beta function. The last identity can be shown by changing of variable, z = sin^{2}θ. In Table 1, some special forms are listed for B and I in lower dimensional spaces.
AREA OF A HYPERSPHERICAL CAP
A hypersphere can be cut into two parts, two caps, by a hyperplane. In the following, the formulas are for the smaller cap (φ≤π/2). The extension to larger caps is straight forward and thus is ignored. The area of a hyperspherical cap in a nsphere of radius r can be obtained by integrating the surface area of an (n1)sphere of radius rsinθ with arc element rdθ over a great circle arc, that is:
It can be shown that the surface area of a cap in a 2sphere (a circle) is the arc length, i.e., 2φr and the surface area of a cap in a 3sphere (a usual ball) is or 2π (1cosφ)r^{2} or 2πrh, where, h = (1cosφ) r is the cap height.
The regularized incomplete beta factor in Eq. 1 can be interpreted as the probability of a random vector on a hemisphere falling onto the cap or the cap is a set of such random vectors. Immediately, this formula provides one mechanism for randomly picking a point from a hemisphere:
• 
Generate u from a beta distribution with shape parameters
(n1)/2 and 1/2 
• 
Generate a random vector x_{n1} from an (n1)sphere
of radius 
• 
Then, x_{n} = {x_{n1}, }
is a random vector from an ndimensional hemisphere 
VOLUME OF A HYPERSPHERICAL CAP
Similarly, the volume of a hyperspherical cap in an nsphere of radius r can be obtained by integrating the volume of an (n1)sphere of radius rsinθ with height element drcosθ, i.e.:
For n = 2, V_{2}^{cap}(r) is the area of a circle segment, i.e., (φsinφcosφ)r^{2}. For n = 3, V_{3}^{cap} (r) = (2/3cosφ+1/3cos^{3}φ)πr^{3}. The Eq. 3 can be interpreted in the similar way as the area equation and the random number generator can be devised similarly.
DISCUSSION
With the area formula of a cap expressed in terms of the sphere area and the relationship between the volume of a hyperspherical sector V_{n}^{sector} and the area of the cap, in a nsphere of radius r:
the volume of a hypersector is immediate:
Special cases are V_{2}^{sector}(r) = φr^{2} and V_{3}^{sector}(r) = 2/3π(1cosφ)r^{3}.
The volume of a hyperspherical cone V_{n}^{cone} is also easy to derive by the difference between the sector volume and the cap volume, V_{n}^{cone}(r) = V_{n}^{sector}(r)V_{n}^{cap}(r) = 1/nV_{n1}(rsinφ)rcosφ. This shows that the volume of a cone is 1/n·volume of base·height. For n = 2 and 3, V_{2}^{cone}(r) = sinφcosφr^{2} and V_{3}^{cone}(r) = π/3sin^{2}φcosφr^{3}.
The regularized incomplete beta function is widely available in scientific
software packages such as the betainc function in MATLAB, the pbeta function
(the cumulative density function for beta distribution) in R (http://www.rproject.org)
and the gsl_sf_beta_inc function in gsl library (http://www.gnu.org/software/gsl/).
In summary, the area and volume formulas for a hyperspherical cap provided in this note are concise, easy to understand and compute.
ACKNOWLEDGMENTS
The author would like to thank Michael E. Andrew and Robert Mnatsakanov for their thoughtful discussion. The findings and conclusions in this report are those of the author(s) and do not necessarily represent the views of the National Institute for Occupational Safety and Health.