408 edge_set(50, -10.999999999999998224, -10.0, 50.0, &e1);
409 edge_set(-10.0, 50.0, -10.272779983831613393, -16.937003313332997578, &e2);
414 e1.
start.
lat = 0.74123572595649878103;
415 e1.
start.
lon = -2.1496353191142714145;
416 e1.
end.
lat = 0.74123631950116664058;
417 e1.
end.
lon = -2.1496353248304860273;
418 e2.
start.
lat = 0.73856343764436815924;
419 e2.
start.
lon = -2.1461493501950630325;
420 e2.
end.
lat = 0.70971354024834598651;
421 e2.
end.
lon = 2.1082194552519770703;
426 edge_set(-123.165031277506, 42.4696787216231, -123.165031605021, 42.4697127292275, &e1);
448 CU_ASSERT_DOUBLE_EQUAL(g.
lat, 0.0, 0.00001);
449 CU_ASSERT_DOUBLE_EQUAL(g.
lon, 0.0, 0.00001);
454 edge_set(0.0, -1.0, 0.0, -2.0, &e2);
467 printf(
"g = (%.15g %.15g)\n", g.
lon, g.
lat);
468 printf(
"rv = %d\n", rv);
470 CU_ASSERT_DOUBLE_EQUAL(g.
lon, 0.0, 0.00001);
482 printf(
"g = (%.15g %.15g)\n", g.
lon, g.
lat);
483 printf(
"rv = %d\n", rv);
485 CU_ASSERT_DOUBLE_EQUAL(g.
lat, 0.0, 0.00001);
486 CU_ASSERT_DOUBLE_EQUAL(g.
lon, 0.0, 0.00001);
490 edge_set(-179.0, -1.0, 179.0, 1.0, &e1);
491 edge_set(-179.0, 1.0, 179.0, -1.0, &e2);
494 CU_ASSERT_DOUBLE_EQUAL(g.
lat, 0.0, 0.00001);
495 CU_ASSERT_DOUBLE_EQUAL(fabs(g.
lon), 180.0, 0.00001);
499 edge_set(-170.0, 0.0, 170.0, 0.0, &e1);
500 edge_set(180.0, -10.0, 180.0, 10.0, &e2);
503 CU_ASSERT_DOUBLE_EQUAL(g.
lat, 0.0, 0.00001);
504 CU_ASSERT_DOUBLE_EQUAL(fabs(g.
lon), 180.0, 0.00001);
508 edge_set(-180.0, 80.0, 0.0, 80.0, &e1);
509 edge_set(90.0, 80.0, -90.0, 80.0, &e2);
512 CU_ASSERT_DOUBLE_EQUAL(g.
lat, 90.0, 0.00001);
516 edge_set(45.0, 10.0, 50.0, 20.0, &e1);
517 edge_set(45.0, 10.0, 50.0, 20.0, &e2);
523 edge_set(40.0, 0.0, 70.0, 0.0, &e1);
524 edge_set(60.0, 0.0, 50.0, 0.0, &e2);
527 CU_ASSERT_EQUAL(rv, 2);
530 edge_set(-180.0, 80.0, 0.0, 80.0, &e1);
531 edge_set(90.0, 80.0, -90.0, 90.0, &e2);
538 printf(
"g = (%.15g %.15g)\n", g.
lon, g.
lat);
539 printf(
"rv = %d\n", rv);
541 CU_ASSERT_DOUBLE_EQUAL(g.
lat, 90.0, 0.00001);
545 edge_set(-180.0, 80.0, 0.0, 90.0, &e1);
546 edge_set(90.0, 80.0, -90.0, 90.0, &e2);
553 printf(
"g = (%.15g %.15g)\n", g.
lon, g.
lat);
554 printf(
"rv = %d\n", rv);
556 CU_ASSERT_DOUBLE_EQUAL(g.
lat, 90.0, 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.
#define LW_TRUE
Return types for functions with status returns.
static void point_rad2deg(GEOGRAPHIC_POINT *p)
Convert a point from radians to degrees.
int edge_intersection(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *g)
Returns true if an intersection can be calculated, and places it in *g.