#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "tests.h"
{
double base_vector[3], vector_a[3], vector_b[3];
LLtoXYZ(base_point[0], base_point[1], base_vector);
LLtoXYZ(point_a[0], point_a[1], vector_a);
LLtoXYZ(point_b[0], point_b[1], vector_b);
double distance_a, distance_b;
if (distance_a >= distance_b)
PUT_ERR("error in distance calculation\n");
}
{
double const tol = 1e-10;
double angles[] = {-M_PI_2 +
tol, -M_PI_4, -
tol, 0,
double offsets[] = {-6.0*M_PI, -4.0*M_PI, -2.0*M_PI, 0,
2.0*M_PI, 4.0*M_PI, 6.0*M_PI};
double start[] = {-M_PI, -M_PI_2, -M_PI_4, -M_1_PI, -
tol, 0,
tol, M_1_PI, M_PI_4, M_PI_2, M_PI};
for (size_t i = 0; i < sizeof(angles) / sizeof(angles[0]); ++i) {
for (size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j) {
for (size_t k = 0; k < sizeof(offsets) / sizeof(offsets[0]); ++k) {
for (size_t l = 0; l < sizeof(start) / sizeof(start[0]); ++l) {
double a_lon = start[l] + offsets[j] + angles[i];
double b_lon = start[l] + offsets[k];
PUT_ERR("error in get_angle\n");
}
}
}
}
}
{
.sq_crd = DBL_MAX};
.sq_crd = DBL_MAX};
PUT_ERR("error in yac_extents_overlap\n");
}
{
.sq_crd = DBL_MAX};
.sq_crd = DBL_MAX};
PUT_ERR("error in yac_extents_overlap\n");
}
return TEST_EXIT_CODE;
}
int yac_extents_overlap(struct bounding_circle *extent_a, struct bounding_circle *extent_b)
int main(int argc, char **argv)
static const struct sin_cos_angle SIN_COS_LOW_TOL
static const struct sin_cos_angle SIN_COS_M_PI
static int sub_angles(struct sin_cos_angle a, struct sin_cos_angle b, struct sin_cos_angle *restrict sub)
static double get_angle(double a_lon, double b_lon)
static void LLtoXYZ(double lon, double lat, double p_out[])
static double get_vector_angle(double const a[3], double const b[3])
struct sin_cos_angle inc_angle
angle between the middle point and the boundary of the spherical cap