12 double north_pole[3]) {
20 "new north pole is the original north pole "
21 "(new north pole (%.3lf; %.3lf; %.3lf); angle (sin: %e, cos: %e)",
22 north_pole[0], north_pole[1], north_pole[2], rot_angle.
sin, rot_angle.
cos);
26 "new north pole is on the southern hemisphere "
27 "(new north pole (%.3lf; %.3lf; %.3lf); angle (sin: %e, cos: %e)",
28 north_pole[0], north_pole[1], north_pole[2], rot_angle.
sin, rot_angle.
cos);
36 for (
size_t i = 0; i < num_coordinates; ++i) {
39 coordinates[i][0] = temp[0];
40 coordinates[i][1] = temp[1];
41 coordinates[i][2] = temp[2];
46 size_t nbr_vertices[2], int
cyclic[2],
47 double *lon_vertices,
double *lat_vertices,
48 double north_pol_lon,
double north_pol_lat,
49 void (*LLtoXYZ_ptr)(double, double,
double[])) {
53 size_t num_cells_2d[2] =
54 {nbr_vertices[0] - (
cyclic[0]?0:1), nbr_vertices[1] - (
cyclic[1]?0:1)};
55 size_t num_vertices_2d[2] = {num_cells_2d[0] + (
cyclic[0]?0:1), num_cells_2d[1] + 1};
56 size_t num_vertices = num_vertices_2d[0] * num_vertices_2d[1];
58 (num_cells_2d[0] + (
cyclic[0]?0:1)) * num_cells_2d[1] +
59 num_cells_2d[0] * (num_cells_2d[1] + 1);
63 for (
size_t i = 0, k = 0; i < num_vertices_2d[1]; ++i)
64 for (
size_t j = 0; j < num_vertices_2d[0]; ++j, ++k)
69 LLtoXYZ_ptr(north_pol_lon, north_pol_lat, north_pole);
83 size_t nbr_vertices[2], int
cyclic[2],
84 double *lon_vertices,
double *lat_vertices,
85 double north_pol_lon,
double north_pol_lat) {
89 nbr_vertices,
cyclic, lon_vertices, lat_vertices,
90 north_pol_lon, north_pol_lat,
LLtoXYZ);
94 size_t nbr_vertices[2], int
cyclic[2],
95 double *lon_vertices,
double *lat_vertices,
96 double north_pol_lon,
double north_pol_lat) {
100 nbr_vertices,
cyclic, lon_vertices, lat_vertices,
#define YAC_ASSERT(exp, msg)
static struct sin_cos_angle get_vector_angle_2(double const a[3], double const b[3])
static void crossproduct_kahan(double const a[], double const b[], double cross[])
static const struct sin_cos_angle SIN_COS_TOL
static const struct sin_cos_angle SIN_COS_M_PI_2
static void rotate_vector2(double axis[], struct sin_cos_angle angle, double v_in[], double v_out[])
static void LLtoXYZ_deg(double lon, double lat, double p_out[])
static int compare_angles(struct sin_cos_angle a, struct sin_cos_angle b)
static void normalise_vector(double v[])
@ YAC_GREAT_CIRCLE_EDGE
great circle
struct yac_basic_grid_data yac_generate_basic_grid_data_reg2d_common(size_t nbr_vertices[2], int cyclic[2])
struct yac_basic_grid_data yac_generate_basic_grid_data_reg_2d_rot(size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices, double north_pol_lon, double north_pol_lat)
struct yac_basic_grid_data yac_generate_basic_grid_data_reg_2d_rot_deg(size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices, double north_pol_lon, double north_pol_lat)
void yac_rotate_coordinates(yac_coordinate_pointer coordinates, size_t num_coordinates, double north_pole[3])
static struct yac_basic_grid_data yac_generate_basic_grid_data_reg_2d_rot_(size_t nbr_vertices[2], int cyclic[2], double *lon_vertices, double *lat_vertices, double north_pol_lon, double north_pol_lat, void(*LLtoXYZ_ptr)(double, double, double[]))
yac_coordinate_pointer vertex_coordinates
enum yac_edge_type * edge_type
static void LLtoXYZ(double lon, double lat, double p_out[])
#define YAC_ASSERT_F(exp, format,...)
double(* yac_coordinate_pointer)[3]