95 double dir1, dist1, dir2, dist2;
103 CU_ASSERT_DOUBLE_EQUAL(e.
lon, 0.1, 1e-14);
104 CU_ASSERT_DOUBLE_EQUAL(e.
lat, 0.0, 1e-14);
110 CU_ASSERT_DOUBLE_EQUAL(dist1, dist2, 1e-14);
111 CU_ASSERT_DOUBLE_EQUAL(dir1, dir2, 1e-14);
117 CU_ASSERT_DOUBLE_EQUAL(
s.lon, 0.0, 1e-14);
118 CU_ASSERT_DOUBLE_EQUAL(
s.lat, 0.0, 1e-14);
125 CU_ASSERT_DOUBLE_EQUAL(dir1, 0.0, 1e-14);
126 CU_ASSERT_DOUBLE_EQUAL(dist1, 0.0034906585039887, 1e-14);
133 CU_ASSERT_DOUBLE_EQUAL(dir2, 0.0, 1e-14);
134 CU_ASSERT_DOUBLE_EQUAL(dist2, 0.0174532925199433, 1e-14);
140 CU_ASSERT_DOUBLE_EQUAL(dir2, 89.991273575329292895136 * M_PI / 180.0, 1e-14);
141 CU_ASSERT_DOUBLE_EQUAL(dist2, 0.0174506342314906, 1e-14);
147 CU_ASSERT_DOUBLE_EQUAL(dir2, M_PI, 1e-14);
148 CU_ASSERT_DOUBLE_EQUAL(dist2, 0.0174532925199433, 1e-14);
154 CU_ASSERT_DOUBLE_EQUAL(dir2, -89.991273575329292895136 * M_PI / 180.0, 1e-14);
155 CU_ASSERT_DOUBLE_EQUAL(dist2, 0.0174506342314906, 1e-14);
161 CU_ASSERT_DOUBLE_EQUAL(dir2, 44.978182941465044354783 * M_PI / 180.0, 1e-14);
162 CU_ASSERT_DOUBLE_EQUAL(dist2, 0.0246782972905467, 1e-14);
168 CU_ASSERT_DOUBLE_EQUAL(dir2, -134.995636455344851488216 * M_PI / 180.0, 1e-14);
169 CU_ASSERT_DOUBLE_EQUAL(dist2, 0.0246820563917664, 1e-14);
int sphere_project(const GEOGRAPHIC_POINT *r, double distance, double azimuth, GEOGRAPHIC_POINT *n)
Given a starting location r, a distance and an azimuth to the new point, compute the location of the ...
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
Given two points on a unit sphere, calculate their distance apart in radians.
double sphere_direction(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e, double d)
Given two points on a unit sphere, calculate the direction from s to e.
Point in spherical coordinates on the world.