phaser/src/geom/circle/ContainsPoint.js

26 lines
772 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
2016-12-29 00:17:20 +00:00
var Contains = require('./Contains');
/**
2018-01-26 04:18:22 +00:00
* Check to see if the Circle contains the given Point object.
*
* @function Phaser.Geom.Circle.ContainsPoint
* @since 3.0.0
*
2018-01-26 04:18:22 +00:00
* @param {Phaser.Geom.Circle} circle - The Circle to check.
2018-03-20 15:01:08 +00:00
* @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not.
2017-10-13 13:11:54 +00:00
*
2018-01-26 04:18:22 +00:00
* @return {boolean} True if the Point coordinates are within the circle, otherwise false.
*/
2016-12-29 00:17:20 +00:00
var ContainsPoint = function (circle, point)
{
return Contains(circle, point.x, point.y);
};
module.exports = ContainsPoint;