Suppose, I have a closed 2D region of data points.
𝓡 =
DiscretizeRegion[
ImplicitRegion[(x - 2)^2 + (y - 3)^2 <= 1 && z == 5, {x, y, z}],
MaxCellMeasure -> 0.0001];
points = RandomPoint[𝓡, 500];
Now, I want to compute the solid angle subtended by the region so covered at the origin. The formula is: $$\int\int_{\mathcal{R}}\sin \theta \;d\theta\;d \phi$$
I tried three ways:
pointsInPolar = ToPolarCoordinates[#] & /@ points;
Integrate[Sin[θ],
Element[{r, θ, ϕ},
MeshRegion[pointsInPolar, Point[Range[500]]]]]
(*472.178*)
Integrate[Sqrt[x^2 + y^2]/
Sqrt[x^2 + y^2 + z^2], {x, y, z} ∈ MeshRegion[points, Point[Range[500]]]]
(*291.617*)
Integrate[Sqrt[x^2 + y^2]/
Sqrt[x^2 + y^2 + z^2], {x, y, z} ∈ ConvexHullMesh[points]]
The last one flags an error.
How to go about doing it?
Edit 1: Here is a little better region, in the sense that I can easily determine its solid angle:
𝓡 =
DiscretizeRegion[
ImplicitRegion[x^2 + y^2 <= 1/2 && z == 1/Sqrt[2], {x, y, z}],
MaxCellMeasure -> 0.0001];
points = RandomPoint[𝓡, 500000];
The exact answer is $2 \pi (1-\cos \theta)$ which in this case evaluates to 1.8403.
Region
object in order to useIntegrate
. $\endgroup$