phaser/src/geom/circle/Area.js

23 lines
535 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2020-01-15 12:07:09 +00:00
* @copyright 2020 Photon Storm Ltd.
2019-05-10 15:15:04 +00:00
* @license {@link https://opensource.org/licenses/MIT|MIT License}
2018-02-12 16:01:20 +00:00
*/
/**
2018-01-26 04:18:22 +00:00
* Calculates the area of the circle.
*
* @function Phaser.Geom.Circle.Area
* @since 3.0.0
*
* @param {Phaser.Geom.Circle} circle - The Circle to get the area of.
2017-10-13 13:11:54 +00:00
*
* @return {number} The area of the Circle.
*/
2016-12-29 00:17:20 +00:00
var Area = function (circle)
{
return (circle.radius > 0) ? Math.PI * circle.radius * circle.radius : 0;
};
module.exports = Area;