Version: dev

polygon_area

Stable function · Relational keys and geometry

Tier: stable · Kind: function · Topic: Relational keys and geometry

JuliaTypeScriptPythonRustGo
not exportednot exportedpolygon_areapolygon_areanot exported

Julia

Julia does not export this function.

TypeScript

TypeScript does not export this function.

Python

polygon_area(ring: np.ndarray, manifold: str, radius: float = 1.0) -> float

Reference (unsigned) area of an overlap ring under manifold.

Planar ⇒ shoelace / Gauss–Green; spherical / geodesic ⇒ the spherical-excess sum (radius = sphere radius / characteristic length, default the unit sphere). Returns 0.0 for a degenerate (< 3 vertex) ring — an empty clip. This is the imperative cross-check oracle for the sum_product polygon_area FAQ: the production polygon area routes through that FAQ (earthsci_ast.area_faq.polygon_area_via_faq ) for both manifolds, and this function encodes the same formula the FAQ body does.

Source

Rust

pub fn polygon_area(ring: &[(f64, f64)], manifold: Manifold) -> Result<f64, GeometryError>

Unsigned polygon_area of an overlap ring under manifold — the imperative cross-check oracle for the polygon_area sum_product FAQ (RFC §8.1). Planar ⇒ shoelace / Gauss–Green; spherical / geodesic ⇒ the great-circle-edge area in steradians (unit sphere) via s2rst. A degenerate (< 3 vertex) ring — an empty clip — is 0.0. The conservative-regridding assembly (a regridding document’s build-time aggregates, evaluated by crate::prepare’s observed-graph pass) computes the build-once factor A_ij through the FAQ (crate::area_faq::polygon_area_faq); this function is the same value that FAQ encodes, kept as the independent oracle (mirrors Python geometry.polygon_area).

Target-agnostic in the strong sense: the spherical arm defers to spherical_area, which is the SAME pure-Rust s2rst kernel on every target — there is no wasm-only failure mode left to guard against.

Source · Rust docs

Go

Go does not export this function.