Sha256: 31756663beeb72ed5ac38313263d1118a96206ed8284e169f8eee92e2dc1a5aa

Contents?: true

Size: 545 Bytes

Versions: 4

Compression:

Stored size: 545 Bytes

Contents

function eckert6(λ, φ) {
  var k = (1 + π / 2) * Math.sin(φ);
  for (var i = 0, δ = Infinity; i < 10 && Math.abs(δ) > ε; i++) {
    φ -= δ = (φ + Math.sin(φ) - k) / (1 + Math.cos(φ));
  }
  k = Math.sqrt(2 + π);
  return [
    λ * (1 + Math.cos(φ)) / k,
    2 * φ / k
  ];
}

eckert6.invert = function(x, y) {
  var j = 1 + π / 2,
      k = Math.sqrt(j / 2);
  return [
    x * 2 * k / (1 + Math.cos(y *= k)),
    asin((y + Math.sin(y)) / j)
  ];
};

(d3.geo.eckert6 = function() { return projection(eckert6); }).raw = eckert6;

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
d3js-plugins-rails-0.0.4 vendor/assets/javascripts/d3/plugins/geo/projection/eckert6.js
d3js-plugins-rails-0.0.3 vendor/assets/javascripts/d3/plugins/geo/projection/eckert6.js
d3js-plugins-rails-0.0.2 vendor/assets/javascripts/d3/plugins/geo/projection/eckert6.js
d3js-plugins-rails-0.0.1 vendor/assets/javascripts/d3/plugins/geo/projection/eckert6.js