arcade-physics
Version:
Use Arcade Physics without Phaser.
26 lines • 932 B
JavaScript
;
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).
*
* The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate
* travels down the screen.
*
* @function Phaser.Math.Angle.BetweenPointsY
* @since 3.0.0
*
* @param {Phaser.Types.Math.Vector2Like} point1 - The first point.
* @param {Phaser.Types.Math.Vector2Like} point2 - The second point.
*
* @return {number} The angle in radians.
*/
const BetweenPointsY = (point1, point2) => {
return Math.atan2(point2.x - point1.x, point2.y - point1.y);
};
exports.default = BetweenPointsY;
//# sourceMappingURL=BetweenPointsY.js.map