Sha256: 9712f6822271c85f7fe857a6a8dabe83ee3c2802746afda3c50b380c98b76191

Contents?: true

Size: 464 Bytes

Versions: 4

Compression:

Stored size: 464 Bytes

Contents

import "projection";

function eckert2(λ, φ) {
  var α = Math.sqrt(4 - 3 * Math.sin(Math.abs(φ)));
  return [
    2 / Math.sqrt(6 * π) * λ * α,
    sgn(φ) * Math.sqrt(2 * π / 3) * (2 - α)
  ];
}

eckert2.invert = function(x, y) {
  var α = 2 - Math.abs(y) / Math.sqrt(2 * π / 3);
  return [
    x * Math.sqrt(6 * π) / (2 * α),
    sgn(y) * asin((4 - α * α) / 3)
  ];
};

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
d3js-plugins-rails-0.0.8 vendor/assets/javascripts/d3/plugins/geo/projection/eckert2.js
d3js-plugins-rails-0.0.7 vendor/assets/javascripts/d3/plugins/geo/projection/eckert2.js
d3js-plugins-rails-0.0.6 vendor/assets/javascripts/d3/plugins/geo/projection/eckert2.js
d3js-plugins-rails-0.0.5 vendor/assets/javascripts/d3/plugins/geo/projection/eckert2.js