Skip to content

Commit

Permalink
Merge branch 'safe-sin'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Feb 27, 2014
2 parents 04fa5dd + bef5de7 commit a4bd167
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3",
"version": "3.4.2",
"version": "3.4.3",
"main": "d3.js",
"scripts": [
"d3.js"
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"animation",
"canvas"
],
"version": "3.4.2",
"version": "3.4.3",
"main": "d3.js",
"scripts": [
"d3.js"
Expand Down
10 changes: 5 additions & 5 deletions d3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
!function() {
var d3 = {
version: "3.4.2"
version: "3.4.3"
};
if (!Date.now) Date.now = function() {
return +new Date();
Expand Down Expand Up @@ -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(adλ), v = k * sdλ * Math.sin(adλ);
d3_geo_areaRingSum.add(Math.atan2(v, u));
λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;
}
Expand Down Expand Up @@ -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(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
polarAngle += antimeridian ? + sdλ * τ : ;
if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
d3_geo_cartesianNormalize(arc);
Expand Down
6 changes: 3 additions & 3 deletions d3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3",
"version": "3.4.2",
"version": "3.4.3",
"description": "A small, free JavaScript library for manipulating documents based on data.",
"keywords": [
"dom",
Expand Down
6 changes: 4 additions & 2 deletions src/geo/area.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(adλ),
v = k * sdλ * Math.sin(adλ);
d3_geo_areaRingSum.add(Math.atan2(v, u));

// Advance the previous points.
Expand Down
8 changes: 5 additions & 3 deletions src/geo/point-in-polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));

polarAngle += antimeridian ? + ( >= 0 ? τ : -τ): ;
polarAngle += antimeridian ? + sdλ * τ : ;

// Are the longitudes either side of the point's meridian, and are the
// latitudes smaller than the parallel?
Expand Down
2 changes: 1 addition & 1 deletion src/start.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
!function(){
var d3 = {version: "3.4.2"}; // semver
var d3 = {version: "3.4.3"}; // semver

0 comments on commit a4bd167

Please sign in to comment.