uxarray.grid.arcs.point_within_gca

uxarray.grid.arcs.point_within_gca#

uxarray.grid.arcs.point_within_gca(pt, gca_cart, is_directed=False)#

Check if a point lies on a given Great Circle Arc (GCA). The anti- meridian case is also considered.

Parameters:
  • pt (numpy.ndarray (float)) – Cartesian coordinates of the point.

  • gca_cart (numpy.ndarray of shape (2, 3), (np.float or gmpy2.mpfr)) – Cartesian coordinates of the Great Circle Arc (GCR).

  • is_directed (bool, optional, default = False) – If True, the GCA is considered to be directed, which means it can only from v0–>v1. If False, the GCA is undirected, and we will always assume the small circle (The one less than 180 degree) side is the GCA. The default is False. For the case of the anti-podal case, the direction is v_0–> the pole point that on the same hemisphere as v_0–>v_1

Returns:

True if the point lies between the two endpoints of the GCR, False otherwise.

Return type:

bool

Raises:
  • ValueError – If the input GCR spans exactly 180 degrees (π radians), as this GCR can have multiple planes. In such cases, consider breaking the GCR into two separate GCRs.

  • ValueError – If the input GCR spans more than 180 degrees (π radians). In such cases, consider breaking the GCR into two separate GCRs.

Notes

The function checks if the given point is on the Great Circle Arc by considering its cartesian coordinates and accounting for the anti-meridian case.

The anti-meridian case occurs when the GCR crosses the anti-meridian (0 longitude). In this case, the function handles scenarios where the GCA spans across more than 180 degrees, requiring specific operation.

The function relies on the _angle_of_2_vectors and is_between functions to perform the necessary calculations.

Please ensure that the input coordinates are in radians and adhere to the ERROR_TOLERANCE value for floating-point comparisons.