Skip to content

Commit 27bdbba

Browse files
committed
1 parent 4c31623 commit 27bdbba

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/geom/Line.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Object.defineProperty(Phaser.Line.prototype, "length", {
207207
Object.defineProperty(Phaser.Line.prototype, "angle", {
208208

209209
get: function () {
210-
return Math.atan2(this.end.x - this.start.x, this.end.y - this.start.y);
210+
return Math.atan2(this.end.y - this.start.y, this.end.x - this.start.x);
211211
}
212212

213213
});

src/math/Math.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ Phaser.Math = {
336336
* @return {number}
337337
*/
338338
angleBetween: function (x1, y1, x2, y2) {
339-
return Math.atan2(x2 - x1, y2 - y1);
339+
return Math.atan2(y2 - y1, x2 - x1);
340340
},
341341

342342
/**
@@ -347,7 +347,7 @@ Phaser.Math = {
347347
* @return {number}
348348
*/
349349
angleBetweenPoints: function (point1, point2) {
350-
return Math.atan2(point2.x - point1.x, point2.y - point1.y);
350+
return Math.atan2(point2.y - point1.y, point2.x - point1.x);
351351
},
352352

353353
/**

0 commit comments

Comments
 (0)