pyguymer3.geo.calc_loc_from_loc_and_bearing_and_dist

pyguymer3.geo.calc_loc_from_loc_and_bearing_and_dist(lon1_deg, lat1_deg, alpha1_deg, s_m, /, *, eps=1e-12, nIter=100)[source]

Calculate the location and reverse bearing from another location and a forward bearing and a distance.

This function reads in coordinates (in degrees) on the surface of the Earth, a bearing (in degrees) and a distance (in metres). It then calculates the coordinates (in degrees) that are at the end of the vector and the bearing (in degrees) back to the first coordinate.

Parameters:
  • lon1_deg (float) – the longitude of the first coordinate (in degrees)

  • lat1_deg (float) – the latitude of the first coordinate (in degrees)

  • alpha1_deg (float) – the bearing to the second coordinate from the first coordinate (in degrees)

  • s_m (float) – the distance between the two coordinates (in metres)

  • eps (float, optional) – the tolerance of the Vincenty formula iterations

  • nIter (int, optional) – the maximum number of iterations (particularly the Vincenty formula)

Returns:

  • lon2_deg (float) – the longitude of the second coordinate (in degrees)

  • lat2_deg (float) – the latitude of the second coordinate (in degrees)

  • alpha2_deg (float) – the bearing to the first coordinate from the second coordinate (in degrees)

Notes

This function uses Vincenty’s formulae ; there is a JavaScript implementation online too.

lambda is a reserved word in Python so I use lam as my variable name instead.

Copyright 2017 Thomas Guymer [1]

References