uxarray.grid.arcs.on_minor_arc

Contents

uxarray.grid.arcs.on_minor_arc#

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

Return True if q lies on the minor great-circle arc from a to b.

Uses _orient3d_on_sphere_value_xyz (a compensated cross product) for the collinearity test and dot products for the interval check. Compared to point_within_gca, this avoids the arctan2 call that guards against 180-degree arcs and avoids the separate plane-membership check via np.cross + np.dot.

Parameters:
  • q (np.ndarray, shape (3,)) – Query point (unit vector).

  • a (np.ndarray, shape (3,)) – Endpoints of the great-circle arc (unit vectors).

  • b (np.ndarray, shape (3,)) – Endpoints of the great-circle arc (unit vectors).

  • tol (float, optional) – Tolerance for the collinearity and interval checks.

Returns:

1 if q lies on the minor arc ab, 0 otherwise. Returned as an integer mask (not bool) so callers can multiply it into validity products. An attempt to implement a similar Python function that provides the same functionality as AccuSphGeom’s on_minor_arc_tol_ptr.

Return type:

int