itacart.metrics.cell_base_angle
- itacart.metrics.cell_base_angle(cell, output='degrees')[source]
Ellipsoidal image of the 45-degree angle of the sinusoidal plane.
On the sinusoidal plane every ITACaRT cell is the same parallelogram: Figure 1 of Silva, Dietzsch and Shiguemori (2025) places its vertices at
{x, y},{x + l, y},{x, y + l}and{x - l, y + l}, so the base equals the height and the acute angle is exactly 45 degrees. This function reports what that angle becomes once the cell is carried to the WGS84 ellipsoid.It is measured at the anchor, between two lines. One is the parallel, which is not a geodesic: its direction at the anchor is the due east and due west tangent, and the arm taken is the one the 45 degrees opens against, opposite the cell’s base. The other is the geodesic from the anchor to the vertex at the most negative X in the cell’s own frame – the corner the shear displaces – in a parallelogram, a triangle or a trapezoid alike.
Reading the base as a geodesic chord instead of as a parallel biases the result by half the convergence of the meridians across the base. That bias is zero at the equator, where a parallel is a geodesic, and it grows with latitude: 0.023 degree at row 300 and 0.284 at row 900, where it is the whole difference between 89.426479 and 89.710055.
The angle is a function of
(X, Y), the lattice position, not of latitude. Along row 0 it grows with longitude at 3.95e-4 degree per degree, from 45.000035 at column 1 to 45.070984 at column 2000, at constant latitude throughout. It is also not monotone: it reaches 89.426479 at row 900, where the cell is a square, and keeps opening past a right angle, to 134.375799 at row 950 and 142.6159 in Kamchatka, which is the “severely obtuse angle exceeding 135 degrees” that Figure 8 of the paper shows as a picture. The four quadrants agree to nine decimals at every one of those latitudes.The frame is the cell’s own. Which way a cell leans is read from the side of the prime meridian its anchor lies on, on the plane, and not from its quadrant code: the western half of a meridian triangle and of a polar cap is spelled under an eastern code and leans the western way. Such a cell and its eastern mirror measure the same angle to a few units in the last place.
The angle holds at every resolution. The geodesic is Vincenty’s, which holds its azimuth to the rounding of its inputs at every length, so a centimetre cell is measured to about 4e-5 degree: the rounding of coordinates written in degrees, not the method.
Triangular cells return 0, and the zero is measured rather than declared by a clause. The anchor of a meridian triangle is not a vertex of its ring: it sits at longitude 0 in the middle of the base, and the vertex at the most negative X is the far end of that base, at the same latitude. The side leaving the anchor towards it is the parallel, so the angle against the parallel is zero. The polar caps are triangles whose anchor is on Greenwich at the middle of their base, and they fall under the same rule without a clause of their own. The test is exact rather than a tolerance: a latitude depends on the ordinate alone, the leaning vertex of a triangle shares the anchor’s ordinate, and every other shape puts it one side higher, at every resolution. Zero therefore means a triangle and nothing else.
- Parameters:
cell (
str) – Compositional index string.output (
Literal['degrees','radians','sin'], default:"degrees") –"degrees"for the angle,"radians"for the same angle in radians, or"sin"for its sine. The sine is the multiplicand ofbase * side * sin(angle), so it is the sine of this angle and of no other quantity.
- Return type:
- Returns:
The angle for a single terminal cell, or a positionally aligned list when the index holds several.
- Raises:
GeometryError – If
outputis not one of the three named forms.NonExistentCellError – If any cell of the index names no cell. The predicate is the arbiter and the contract ends there: a spelling it denies is refused rather than answered for the cell it would otherwise fold onto.