Understand the S2 class and spherical geometry framework
masterThe S2 class serves as a namespace for constants and static utility functions related to spherical geometry, including area calculations and edge intersection tests.
Key features include:
- Cell Decomposition: A framework for decomposing the unit sphere into a hierarchy of 'cells' (quadrilaterals bounded by four geodesics). The hierarchy starts by projecting the six faces of a cube onto the sphere and recursively subdividing cells into four children.
- Coordinate Systems: Defines how cube faces are projected to ensure sequentially increasing cell IDs follow a continuous space-filling curve.
Note: The S2 class is not thread-safe for loops and objects that use loops.