31 #include <grass/gis.h>
35 static int adjust_lat(
double *);
38 static int adjust_lon(
double *);
41 static double TAN_A, TAN1, TAN2, L;
79 TAN1 = tan(M_PI_4 + lat1 / 2.0);
80 TAN2 = tan(M_PI_4 + lat2 / 2.0);
81 TAN_A = (lon2 - lon1) / (
log(TAN2) -
log(TAN1));
104 return Degrees(2 * atan(exp((lon - L) / TAN_A) * TAN1) - M_PI_2);
109 static int adjust_lon(
double *lon)
113 while (*lon < -180.0)
121 static int adjust_lat(
double *lat)
int G_begin_rhumbline_equation(double lon1, double lat1, double lon2, double lat2)
Start rhumbline calculations.
double G_rhumbline_lat_from_lon(double lon)
Calculates rhumbline latitude.