Normalized solid angle of a planar cone via inner product
Source:R/formulas_2d.R
solid_angle_2d_inner.RdComputes the normalized solid angle of a two-dimensional simplicial cone
using the dot-product / acos variant of the planar angle formula.
Provided as a complement to solid_angle_2d for numerical
cross-checks.
Value
A single numeric value in \([0, 0.5]\): the planar opening
angle divided by \(2\pi\). Colinear generators return 0.
Details
For unit vectors \(v_1, v_2 \in \mathbb{R}^2\) the opening angle is
$$\theta = \arccos(v_1 \cdot v_2),$$
giving \(\Omega = \theta / (2\pi)\). The dot product is clamped to
\([-1, 1]\) before the acos call to prevent NaN from
floating-point overshoot. The acos formulation loses precision
for vectors very close to colinear or anti-colinear, so for production
use solid_angle_2d (atan2-based) is preferred; this
function is retained as a reference implementation and for verification
tests.
References
Hanson, A. J. (2006). Visualizing Quaternions. Morgan Kaufmann. ISBN 978-0120884001. (Chapter on planar angle conventions.)
See also
solid_angle_2d for the numerically preferred
atan2-based variant; solid_angle_3d for three
dimensions; compute_solid_angle for the dispatcher.