# pyresample.spherical_geometry module

Classes for spherical geometry operations.

class pyresample.spherical_geometry.Arc(start, end)

  Bases: `object`

  An arc of the great circle between two points.

  __init__(start, end)
  angle(other_arc, snap=True)

    Get oriented angle between two arcs.

    Parameters:

      - other_arc (pyresample.spherical_geometry.Arc)

      - snap (boolean) – Snap small angles to 0. Allows for detecting colinearity. Disable snapping when calculating polygon areas as it might lead to negative area values.

  center_angle()

    Get angle of an arc at the center of the sphere.

  intersection(other_arc)

    Determine the intersection point between this arc and another.

    An arc is defined as the shortest tracks between two points.

  intersections(other_arc)

    Get the two intersections of the greats circles defined by the current arc and other_arc.

  intersects(other_arc)

    Determine if this arc and another arc intersect.

    An arc is defined as the shortest tracks between two points.

class pyresample.spherical_geometry.Coordinate(lon=None, lat=None, x__=None, y__=None, z__=None, R__=1)

  Bases: `object`

  Point on earth in terms of lat and lon.

  It expects lon,lat in degrees But self.lat and self.lon are returned in radians !

  __init__(lon=None, lat=None, x__=None, y__=None, z__=None, R__=1)
  cross(point)

    Get cross product with another vector.

  cross2cart(point)

    Compute the cross product, and convert to cartesian coordinates (assuming radius 1).

  distance(point)

    Get distance using Vincenty formula.

  dot(point)

    Get dot product with another vector.

  lat = None
  lon = None
  norm()

    Return the norm of the vector.

  normalize()

    Normalize the vector.

  x__ = None
  y__ = None
  z__ = None

pyresample.spherical_geometry.get_first_intersection(b__, boundaries)

  Get the first intersection on b__ with boundaries.

pyresample.spherical_geometry.get_intersections(b__, boundaries)

  Get the intersections of b__ with boundaries.

  Returns both the intersection coordinates and the concerned boundaries.

pyresample.spherical_geometry.get_next_intersection(p__, b__, boundaries)

  Get the next intersection from the intersection of arcs p__ and b__ along segment b__ with boundaries.

pyresample.spherical_geometry.get_polygon_area(corners)

  Get the area of the convex area defined by corners.

pyresample.spherical_geometry.intersection_polygon(area_corners, segment_corners)

  Get the intersection polygon between two areas.

pyresample.spherical_geometry.modpi(val)

  Put val between -pi and pi.

pyresample.spherical_geometry.point_inside(point, corners)

  Determine if points are inside 4 corner points.

  This uses great circle arcs as area boundaries.