UNPKG

phaser

Version:

A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers from the team at Phaser Studio Inc.

27 lines (23 loc) 665 B
/** * @author samme * @copyright 2013-2025 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Calculate the squared distance between two points. * * @function Phaser.Math.Distance.BetweenPointsSquared * @since 3.22.0 * * @param {Phaser.Types.Math.Vector2Like} a - The first point. * @param {Phaser.Types.Math.Vector2Like} b - The second point. * * @return {number} The squared distance between the points. */ var DistanceBetweenPointsSquared = function (a, b) { var dx = a.x - b.x; var dy = a.y - b.y; return dx * dx + dy * dy; }; module.exports = DistanceBetweenPointsSquared;