Skip to content

Commit 70c6168

Browse files
committed
Rename "xy" argument to "coordinates" for clarity.
1 parent ba7bb1f commit 70c6168

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

d3.geo.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ d3.geo.azimuthal = function() {
2626
];
2727
}
2828

29-
azimuthal.invert = function(xy) {
30-
var x = (xy[0] - translate[0]) / scale,
31-
y = (xy[1] - translate[1]) / scale,
29+
azimuthal.invert = function(coordinates) {
30+
var x = (coordinates[0] - translate[0]) / scale,
31+
y = (coordinates[1] - translate[1]) / scale,
3232
p = Math.sqrt(x * x + y * y),
3333
c = mode === "stereographic" ? 2 * Math.atan(p) : Math.asin(p),
3434
sc = Math.sin(c),
@@ -92,9 +92,9 @@ d3.geo.albers = function() {
9292
];
9393
}
9494

95-
albers.invert = function(xy) {
96-
var x = (xy[0] - translate[0]) / scale,
97-
y = (xy[1] - translate[1]) / scale,
95+
albers.invert = function(coordinates) {
96+
var x = (coordinates[0] - translate[0]) / scale,
97+
y = (coordinates[1] - translate[1]) / scale,
9898
p0y = p0 + y,
9999
t = Math.atan2(x, p0y),
100100
p = Math.sqrt(x * x + p0y * p0y);
@@ -210,9 +210,9 @@ d3.geo.mercator = function() {
210210
];
211211
}
212212

213-
mercator.invert = function(xy) {
214-
var x = (xy[0] - translate[0]) / scale,
215-
y = (xy[1] - translate[1]) / scale;
213+
mercator.invert = function(coordinates) {
214+
var x = (coordinates[0] - translate[0]) / scale,
215+
y = (coordinates[1] - translate[1]) / scale;
216216
return [
217217
360 * x,
218218
2 * Math.atan(Math.exp(-360 * y * d3_radians)) / d3_radians - 90

src/geo/albers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ d3.geo.albers = function() {
2121
];
2222
}
2323

24-
albers.invert = function(xy) {
25-
var x = (xy[0] - translate[0]) / scale,
26-
y = (xy[1] - translate[1]) / scale,
24+
albers.invert = function(coordinates) {
25+
var x = (coordinates[0] - translate[0]) / scale,
26+
y = (coordinates[1] - translate[1]) / scale,
2727
p0y = p0 + y,
2828
t = Math.atan2(x, p0y),
2929
p = Math.sqrt(x * x + p0y * p0y);

src/geo/azimuthal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ d3.geo.azimuthal = function() {
2525
];
2626
}
2727

28-
azimuthal.invert = function(xy) {
29-
var x = (xy[0] - translate[0]) / scale,
30-
y = (xy[1] - translate[1]) / scale,
28+
azimuthal.invert = function(coordinates) {
29+
var x = (coordinates[0] - translate[0]) / scale,
30+
y = (coordinates[1] - translate[1]) / scale,
3131
p = Math.sqrt(x * x + y * y),
3232
c = mode === "stereographic" ? 2 * Math.atan(p) : Math.asin(p),
3333
sc = Math.sin(c),

src/geo/mercator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ d3.geo.mercator = function() {
1111
];
1212
}
1313

14-
mercator.invert = function(xy) {
15-
var x = (xy[0] - translate[0]) / scale,
16-
y = (xy[1] - translate[1]) / scale;
14+
mercator.invert = function(coordinates) {
15+
var x = (coordinates[0] - translate[0]) / scale,
16+
y = (coordinates[1] - translate[1]) / scale;
1717
return [
1818
360 * x,
1919
2 * Math.atan(Math.exp(-360 * y * d3_radians)) / d3_radians - 90

0 commit comments

Comments
 (0)