/// 获取A点绕B点旋转P度后的新坐标/// </summary>/// <param name="Angle">角度</param>/// <param name="CirPoint">圆心坐标</param>/// <param name="MovePoint">移动点的坐标</param>/// <param name="FlagInt">顺时针:1(默认) 逆时针:-1</param>/// <returns></returns> public static Point GetNewPoint(double Angle, Point CirPoint, Point MovePoint, int FlagInt = 1){//将角度转换成弧度double Rage2 = Convert.ToDouble(Angle) / 180 * Math.PI;//计算新坐标Xint newx = (int)((MovePoint.X - CirPoint.X) * Math.Cos(Rage2 * FlagInt) - (MovePoint.Y - CirPoint.Y) * Math.Sin(Rage2 * FlagInt));//计算新坐标Yint newy = (int)((MovePoint.Y - CirPoint.Y) * Math.Cos(Rage2 * FlagInt) + (MovePoint.X - CirPoint.X) * Math.Sin(Rage2 * FlagInt));//计算新坐标Point newpoint = new Point(CirPoint.X + newx, CirPoint.Y + newy);//返回新坐标return newpoint;}
创作不易,小小的支持一下吧!