uxarray.grid.arcs.orient3d_on_sphere

uxarray.grid.arcs.orient3d_on_sphere#

uxarray.grid.arcs.orient3d_on_sphere(a, b, q, tol=1e-15)#

Sign of the orient3d predicate on the unit sphere: -1, 0, or +1.

Evaluates the sign of (a x b) . q using compensated arithmetic to avoid false zero results from floating-point cancellation near great-circle boundaries. The sign determines which side of the great circle through a and b the point q lies on. This is a public spatial predicate (used by point-in-face, bounds, antimeridian handling and available for custom geometry code); it is not part of the AccuXGCA/AccuXConstLat batch kernels.

Parameters:
  • a (np.ndarray, shape (3,)) – Unit vectors on the unit sphere.

  • b (np.ndarray, shape (3,)) – Unit vectors on the unit sphere.

  • q (np.ndarray, shape (3,)) – Unit vectors on the unit sphere.

  • tol (float, optional) – Magnitude below which the result is classified as zero.

Returns:

+1 if q is to the left of a->b, -1 if to the right, 0 if collinear within tol.

Return type:

int