Commit a4bd1670 authored by Mike Bostock's avatar Mike Bostock
Browse files

Merge branch 'safe-sin'

parents 04fa5dd3 bef5de75
{
"name": "d3",
"version": "3.4.2",
"version": "3.4.3",
"main": "d3.js",
"scripts": [
"d3.js"
......
......@@ -10,7 +10,7 @@
"animation",
"canvas"
],
"version": "3.4.2",
"version": "3.4.3",
"main": "d3.js",
"scripts": [
"d3.js"
......
!function() {
var d3 = {
version: "3.4.2"
version: "3.4.3"
};
if (!Date.now) Date.now = function() {
return +new Date();
......@@ -2877,7 +2877,7 @@
function nextPoint(λ, φ) {
λ *= d3_radians;
φ = φ * d3_radians / 2 + π / 4;
var = λ - λ0, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(), v = k * Math.sin();
var = λ - λ0, sdλ = >= 0 ? 1 : -1, adλ = sdλ * , cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(a), v = k * sdλ * Math.sin(a);
d3_geo_areaRingSum.add(Math.atan2(v, u));
λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;
}
......@@ -3339,9 +3339,9 @@
while (true) {
if (j === m) j = 0;
point = ring[j];
var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), = λ - λ0, antimeridian = abs() > π, k = sinφ0 * sinφ;
d3_geo_areaRingSum.add(Math.atan2(k * Math.sin(), cosφ0 * cosφ + k * Math.cos()));
polarAngle += antimeridian ? + ( >= 0 ? τ : -τ) : ;
var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), = λ - λ0, sdλ = >= 0 ? 1 : -1, adλ = sdλ * , antimeridian = adλ > π, k = sinφ0 * sinφ;
d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(a), cosφ0 * cosφ + k * Math.cos(a)));
polarAngle += antimeridian ? + s * τ : ;
if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
d3_geo_cartesianNormalize(arc);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "d3",
"version": "3.4.2",
"version": "3.4.3",
"description": "A small, free JavaScript library for manipulating documents based on data.",
"keywords": [
"dom",
......
......@@ -49,11 +49,13 @@ function d3_geo_areaRingStart() {
// previous point, current point. Uses a formula derived from Cagnoli’s
// theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).
var = λ - λ0,
sdλ = >= 0 ? 1 : -1,
adλ = sdλ * ,
cosφ = Math.cos(φ),
sinφ = Math.sin(φ),
k = sinφ0 * sinφ,
u = cosφ0 * cosφ + k * Math.cos(),
v = k * Math.sin();
u = cosφ0 * cosφ + k * Math.cos(a),
v = k * sdλ * Math.sin(a);
d3_geo_areaRingSum.add(Math.atan2(v, u));
// Advance the previous points.
......
......@@ -31,11 +31,13 @@ function d3_geo_pointInPolygon(point, polygon) {
sinφ = Math.sin(φ),
cosφ = Math.cos(φ),
= λ - λ0,
antimeridian = abs() > π,
sdλ = >= 0 ? 1 : -1,
adλ = sdλ * ,
antimeridian = adλ > π,
k = sinφ0 * sinφ;
d3_geo_areaRingSum.add(Math.atan2(k * Math.sin(), cosφ0 * cosφ + k * Math.cos()));
d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(a), cosφ0 * cosφ + k * Math.cos(a)));
polarAngle += antimeridian ? + ( >= 0 ? τ : -τ): ;
polarAngle += antimeridian ? + s * τ : ;
// Are the longitudes either side of the point's meridian, and are the
// latitudes smaller than the parallel?
......
!function(){
var d3 = {version: "3.4.2"}; // semver
var d3 = {version: "3.4.3"}; // semver
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment