Uniform random point on a hollow spherical cap
Source:R/cone_sampling.R
generate_hollow_cone_sample.RdReturns a single point drawn uniformly from the hollow spherical cap of axis \(\hat{\mu}\) and inner / outer planar angles \(\theta_1 < \theta_2\) in dimension \(n\).
Usage
generate_hollow_cone_sample(
mu_hat,
theta1,
theta2,
method = c("inverse", "rejection")
)Arguments
- mu_hat
Numeric vector. Central axis direction (will be normalized to unit vector).
- theta1
Numeric. Inner planar angle in radians, \(0 \le \theta_1 < \theta_2\).
- theta2
Numeric. Outer planar angle in radians, \(0 < \theta_2 \le \pi\).
- method
Character. Method for generating planar angle:
"inverse"for inverse transform sampling (default), or"rejection"for rejection sampling.
Details
The hollow cone is defined as the set of all unit vectors \(\hat{x}\) satisfying: $$\cos\theta_2 \le \hat{x} \cdot \hat{\mu} \le \cos\theta_1$$
The algorithm generates a random angle \(\theta\) from: $$\theta = \Theta^{-1}(U(\Omega_2 - \Omega_1) + \Omega_1)$$ where \(U \sim \text{Uniform}(0,1)\), \(\Omega_1 = \Theta(\theta_1)\), and \(\Omega_2 = \Theta(\theta_2)\).
References
Arun, I., & Venkatapathi, M. (2025). An O(n) algorithm for generating uniform random vectors in n-dimensional cones. Sankhya A, 87(2), 327-348. doi:10.1007/s13171-025-00387-9
See also
generate_cone_sample for the solid-cap variant;
theta_to_omega, omega_to_theta for the
angle/area maps used internally; verify_cone_uniformity
for sample-level diagnostics.