Skip to contents

Computes the normalized solid angle of a simplicial cone in \(\mathbb{R}^3\) generated by three vectors using the Van Oosterom- Strackee form of the Euler-Lagrange formula. The result is the fraction of the unit sphere covered by the cone.

Usage

solid_angle_3d(v1, v2, v3)

Arguments

v1

Numeric vector of length three; first cone generator.

v2

Numeric vector of length three; second cone generator.

v3

Numeric vector of length three; third cone generator.

Value

A single numeric value in \([0, 1]\). The orthant (\(v_i = e_i\)) returns 0.125; degenerate cones (vanishing triple product) return 0.

Details

The normalized solid angle is computed as $$\Omega = \frac{1}{4\pi}\, 2\, \mathrm{atan2}\!\left(|v_1 \cdot (v_2 \times v_3)|,\ 1 + v_1 \cdot v_2 + v_2 \cdot v_3 + v_3 \cdot v_1\right),$$ where \(v_i\) are the generators normalized to unit Euclidean norm. The expression is the Van Oosterom & Strackee (1983) reformulation of the classical Euler-Lagrange formula for the spherical excess of the triangle \((v_1, v_2, v_3)\) on \(S^2\). The atan2 form resolves the quadrant ambiguity that affects the textbook \(\arctan\) version when the denominator changes sign.

Numerical safeguards: inputs are normalized internally; vectors with near-zero norm trigger an error. When the absolute scalar triple product is below \(10^{-15}\) the cone is considered degenerate and the function returns 0.

References

Van Oosterom, A., & Strackee, J. (1983). The solid angle of a plane triangle. IEEE Transactions on Biomedical Engineering, 30(2), 125-126. doi:10.1109/TBME.1983.325207

Fitisone, A., & Zhou, Y. (2023). Solid angle measure of polyhedral cones. arXiv:2304.11102 (math.CO). https://arxiv.org/abs/2304.11102

See also

solid_angle_3d_det for the matrix-input variant; spherical_triangle_area for the unnormalized spherical excess (steradians) of the same triangle; solid_angle_2d for the planar analogue; compute_solid_angle for the dispatcher that uses this formula automatically when \(n = 3\).

Examples

# Orthogonal octant: 1/8 of the sphere
solid_angle_3d(c(1, 0, 0), c(0, 1, 0), c(0, 0, 1))   # 0.125
#> [1] 0.125

# Narrow cone: small solid angle
v2 <- c(1, 0.1, 0)   / sqrt(1.01)
v3 <- c(1, 0,   0.1) / sqrt(1.01)
solid_angle_3d(c(1, 0, 0), v2, v3)                   # << 0.125
#> [1] 0.0003959095