mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-02 15:50:51 +08:00
ink
This commit is contained in:
@@ -93,5 +93,12 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
return positiveAngle;
|
||||
}
|
||||
|
||||
public static Point RotatePoint(Point point, Point center, double angle)
|
||||
{
|
||||
var x = (point.X - center.X) * Math.Cos(Math.PI / 180.0 * angle) - (point.Y - center.Y) * Math.Sin(Math.PI / 180.0 * angle) + center.X;
|
||||
var y = (point.X - center.X) * Math.Sin(Math.PI / 180.0 * angle) + (point.Y - center.Y) * Math.Cos(Math.PI / 180.0 * angle) + center.Y;
|
||||
return new Point(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user