phaser/src/geom/line/Rotate.js

23 lines
461 B
JavaScript
Raw Normal View History

var RotateAroundXY = require('./RotateAroundXY');
2017-10-13 13:11:54 +00:00
/**
* [description]
*
* @function Phaser.Geom.Line.Rotate
* @since 3.0.0
*
* @param {Phaser.Geom.Line} line - [description]
* @param {number} angle - [description]
*
* @return {Phaser.Geom.Line} [description]
*/
var Rotate = function (line, angle)
{
var x = (line.x1 + line.x2) / 2;
var y = (line.y1 + line.y2) / 2;
return RotateAroundXY(line, x, y, angle);
};
module.exports = Rotate;