phaser/src/math/distance/DistancePower.js

23 lines
516 B
JavaScript
Raw Normal View History

2017-10-06 02:05:01 +00:00
/**
* [description]
*
* @function Phaser.Math.Distance.Power
* @since 3.0.0
*
* @param {number} x1 - [description]
* @param {number} y1 - [description]
* @param {number} x2 - [description]
* @param {number} y2 - [description]
* @param {number} pow - [description]
*
* @return {number} [description]
*/
var DistancePower = function (x1, y1, x2, y2, pow)
{
if (pow === undefined) { pow = 2; }
return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow));
};
module.exports = DistancePower;