Skip to content

Commit

Permalink
Merge 5da4330 into 7f22d7d
Browse files Browse the repository at this point in the history
  • Loading branch information
schwehr committed Apr 20, 2018
2 parents 7f22d7d + 5da4330 commit 5ef0515
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/PJ_isea.c
Expand Up @@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include "proj_internal.h"

#ifndef M_PI
# define M_PI 3.14159265358979323846
Expand Down Expand Up @@ -59,13 +60,19 @@ int hex_iso(struct hex *h) {
}

ISEA_STATIC
int hexbin2(double width, double x, double y,
int *i, int *j) {
void hexbin2(double width, double x, double y, int *i, int *j) {
double z, rx, ry, rz;
double abs_dx, abs_dy, abs_dz;
int ix, iy, iz, s;
struct hex h;

if (pj_is_nan(x) || pj_is_nan(y) || pj_is_nan(width)) {
fprintf(stderr, "hexbin2 cannot handle NaN inputs\n");
*i = 0;
*j = 0;
return;
}

x = x / cos(30 * M_PI / 180.0); /* rotated X coord */
y = y - x / 2.0; /* adjustment for rotated X */

Expand Down Expand Up @@ -105,7 +112,6 @@ int hexbin2(double width, double x, double y,
hex_xy(&h);
*i = h.x;
*j = h.y;
return ix * 100 + iy;
}
#ifndef ISEA_STATIC
#define ISEA_STATIC
Expand Down Expand Up @@ -1134,4 +1140,3 @@ PJ *PROJECTION(isea) {

return P;
}

0 comments on commit 5ef0515

Please sign in to comment.