mirror of
https://github.com/photonstorm/phaser
synced 2025-01-10 12:18:51 +00:00
15 lines
416 B
JavaScript
15 lines
416 B
JavaScript
|
/**
|
||
|
* Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle.
|
||
|
*/
|
||
|
var CircumferencePoint = function (circle, angle, out)
|
||
|
{
|
||
|
if (out === undefined) { out = { x: 0, y: 0 }; }
|
||
|
|
||
|
out.x = circle.x + (circle.radius * Math.cos(angle));
|
||
|
out.y = circle.y + (circle.radius * Math.sin(angle));
|
||
|
|
||
|
return out;
|
||
|
};
|
||
|
|
||
|
module.exports = CircumferencePoint;
|