Permalink
Browse files

Add Gall’s stereographic projection.

  • Loading branch information...
1 parent 2f819e4 commit b9f162c10451bcd059444a792c78e620be617e33 @mbostock mbostock committed Mar 25, 2013
Showing with 20 additions and 0 deletions.
  1. +19 −0 geo/projection/gall-stereographic.js
  2. +1 −0 geo/projection/index.js
@@ -0,0 +1,19 @@
+import "projection";
+
+function gallStereographic(λ, φ) {
+ return [
+ λ / Math.SQRT2,
+ (1 + Math.SQRT2 / 2) * Math.tan/ 2)
+ ];
+}
+
+gallStereographic.invert = function(x, y) {
+ return [
+ x * Math.SQRT2,
+ Math.atan(y / (1 + Math.SQRT2 / 2)) * 2
+ ];
+};
+
+(d3.geo.gallStereographic = function() {
+ return projection(gallStereographic);
+}).raw = gallStereographic;
@@ -20,6 +20,7 @@ import "eckert5";
import "eckert6";
import "eisenlohr";
import "fahey";
+import "gall-stereographic";
import "gringorten";
import "guyou";
import "hammer-retroazimuthal";

0 comments on commit b9f162c

Please sign in to comment.