aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKurt Schwehr <schwehr@google.com>2018-05-20 07:47:50 -0700
committerKurt Schwehr <schwehr@google.com>2018-05-20 07:47:50 -0700
commit8d42763d3536eb67085b0968790da1fea0012641 (patch)
tree3949bdd9490273d45d67cd5ff18cd885d31c977a /src
parent9f9b4505be5cb2006f363e1c0616e586b9d66a3d (diff)
downloadPROJ-8d42763d3536eb67085b0968790da1fea0012641.tar.gz
PROJ-8d42763d3536eb67085b0968790da1fea0012641.zip
isea: Use PJ_TODEG and PJ_TORAD (#991)
Diffstat (limited to 'src')
-rw-r--r--src/PJ_isea.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/PJ_isea.c b/src/PJ_isea.c
index 769b1837..4e0eda32 100644
--- a/src/PJ_isea.c
+++ b/src/PJ_isea.c
@@ -11,6 +11,7 @@
#include <string.h>
#define PJ_LIB__
+#include "proj_internal.h"
#include "proj.h"
#include "projects.h"
@@ -44,9 +45,6 @@
#define ISEA_STD_LAT 1.01722196792335072101
#define ISEA_STD_LON .19634954084936207740
-#define RAD2DEG (180.0/M_PI)
-#define DEG2RAD (M_PI/180.0)
-
struct hex {
int iso;
int x, y, z;
@@ -336,9 +334,9 @@ static int isea_snyder_forward(struct isea_geo * ll, struct isea_pt * out)
/* TODO put these constants in as radians to begin with */
c = constants[SNYDER_POLY_ICOSAHEDRON];
- theta = c.theta * DEG2RAD;
- g = c.g * DEG2RAD;
- G = c.G * DEG2RAD;
+ theta = PJ_TORAD(c.theta);
+ g = PJ_TORAD(c.g);
+ G = PJ_TORAD(c.G);
for (i = 1; i <= 20; i++) {
double z;
@@ -458,7 +456,7 @@ static int isea_snyder_forward(struct isea_geo * ll, struct isea_pt * out)
*/
fprintf(stderr, "impossible transform: %f %f is not on any triangle\n",
- ll->lon * RAD2DEG, ll->lat * RAD2DEG);
+ PJ_TODEG(ll->lon), PJ_TODEG(ll->lat));
exit(EXIT_FAILURE);