点A围绕点B 旋转 A度

Control.prototype.RotatePoint = function (point, center, a) {
    var ang = a / 180 * Math.PI;
    var x = (point.x - center.x) * Math.cos(ang) - (point.y - center.y) * Math.sin(ang) + center.x;
    var y = (point.x - center.x) * Math.sin(ang) + (point.y - center.y) * Math.cos(ang) + center.y;
    return new Point(x, y);
}

你可能感兴趣的:(C#,几何,旋转)