Sha256: 6567b710242456697ae4b7da296151808ccba4a1d5a7e8fd8ff7053e5ba53322

Contents?: true

Size: 499 Bytes

Versions: 4

Compression:

Stored size: 499 Bytes

Contents

function littrow(λ, φ) {
  return [
    Math.sin(λ) / Math.cos(φ),
    Math.tan(φ) * Math.cos(λ)
  ];
}

littrow.invert = function(x, y) {
  var x2 = x * x,
      y2 = y * y,
      y2_1 = y2 + 1,
      cosφ = x
        ? Math.SQRT1_2 * Math.sqrt((y2_1 - Math.sqrt(x2 * x2 + 2 * x2 * (y2 - 1) + y2_1 * y2_1)) / x2 + 1)
        : 1 / Math.sqrt(y2_1);
  return [
    asin(x * cosφ),
    sgn(y) * acos(cosφ)
  ];
};

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

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