738 edge_set(-50.0, 0.0, 50.0, 0.0, &e);
741 CU_ASSERT_DOUBLE_EQUAL(d, M_PI / 180.0, 0.00001);
744 edge_set(-50.0, 0.0, 50.0, 0.0, &e);
749 printf(
"POINT(%.9g %.9g)\n", g.
lon, g.
lat);
750 printf(
"\nDISTANCE == %.8g\n", d);
752 CU_ASSERT_DOUBLE_EQUAL(d, M_PI / 90.0, 0.00001);
753 CU_ASSERT_DOUBLE_EQUAL(closest.
lat, 0.0, 0.00001);
754 CU_ASSERT_DOUBLE_EQUAL(closest.
lon, 0.0, 0.00001);
757 edge_set(149.386990599235, -26.3567415843982, 149.386990599247, -26.3567415843965, &e);
758 point_set(149.386990599235, -26.3567415843982, &g);
760 CU_ASSERT_DOUBLE_EQUAL(d, 0.0, 0.00001);
763 CU_ASSERT_DOUBLE_EQUAL(g.
lat, closest.
lat, 0.00001);
764 CU_ASSERT_DOUBLE_EQUAL(g.
lon, closest.
lon, 0.00001);
Two-point great circle segment from a to b.
static void edge_set(double lon1, double lat1, double lon2, double lat2, GEOGRAPHIC_EDGE *e)
Point in spherical coordinates on the world.
double edge_distance_to_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *gp, GEOGRAPHIC_POINT *closest)
static void point_set(double lon, double lat, GEOGRAPHIC_POINT *p)