22 static double min4(
double,
double,
double,
double);
23 static double min2(
double,
double);
54 if (st->factor <= 0.0) {
75 double G_distance(
double e1,
double n1,
double e2,
double n2)
80 return st->factor * hypot(e1 - e2, n1 - n2);
92 double ax2,
double ay2,
93 double bx1,
double by1,
94 double bx2,
double by2)
101 bx1, by1, bx2, by2, &ra, &rb, &x, &y) > 0)
121 double x1,
double y1,
double x2,
126 double xq, yq, ra, rb;
133 if (dx == 0.0 && dy == 0.0)
136 if (fabs(dy) > fabs(dx)) {
138 yq = (dx / dy) * (xp - xq) + yp;
142 xq = (dy / dx) * (yp - yq) + xp;
155 "code=%d P=(%f,%f) S=(%f,%f)(%f,%f)"),
156 "G_distance_point_to_line_segment", t, xp, yp, x1, y1, x2, y2);
161 if (rb >= 0 && rb <= 1.0)
170 static double min4(
double a,
double b,
double c,
double d)
172 return min2(min2(a,
b), min2(c, d));
175 static double min2(
double a,
double b)
177 return a < b ? a :
b;
void G_begin_geodesic_distance(double, double)
Begin geodesic distance.
int G_begin_distance_calculations(void)
Begin distance calculations.
int G_projection(void)
Query cartographic projection.
double G_geodesic_distance(double, double, double, double)
Calculates geodesic distance.
#define PROJECTION_LL
Projection code - Latitude-Longitude.
int G_get_ellipsoid_parameters(double *, double *)
get ellipsoid parameters
int G_intersect_line_segments(double, double, double, double, double, double, double, double, double *, double *, double *, double *)
void G_warning(const char *,...) __attribute__((format(printf
double G_database_units_to_meters_factor(void)
Conversion to meters.
double G_distance(double e1, double n1, double e2, double n2)
Returns distance in meters.
double G_distance_between_line_segments(double ax1, double ay1, double ax2, double ay2, double bx1, double by1, double bx2, double by2)
Returns distance between two line segments in meters.
double G_distance_point_to_line_segment(double xp, double yp, double x1, double y1, double x2, double y2)
Returns distance between a point and line segment in meters.