Sha256: 9cbeb30d1d9a0d7fad85b131124ee49be3b0adb3f0ebfe2259e71e7a231607c4

Contents?: true

Size: 438 Bytes

Versions: 4

Compression:

Stored size: 438 Bytes

Contents

function craster(λ, φ) {
  var sqrt3 = Math.sqrt(3);
  return [
    sqrt3 * λ * (2 * Math.cos(2 * φ / 3) - 1) / sqrtπ,
    sqrt3 * sqrtπ * Math.sin(φ / 3)
  ];
}

craster.invert = function(x, y) {
  var sqrt3 = Math.sqrt(3),
      φ = 3 * asin(y / (sqrt3 * sqrtπ));
  return [
    sqrtπ * x / (sqrt3 * (2 * Math.cos(2 * φ / 3) - 1)),
    φ
  ];
};

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

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/craster.js
d3js-plugins-rails-0.0.3 vendor/assets/javascripts/d3/plugins/geo/projection/craster.js
d3js-plugins-rails-0.0.2 vendor/assets/javascripts/d3/plugins/geo/projection/craster.js
d3js-plugins-rails-0.0.1 vendor/assets/javascripts/d3/plugins/geo/projection/craster.js