Use float methods for math operations

This commit is contained in:
Dean Herbert 2020-10-01 17:06:05 +09:00
parent b1f2bdd579
commit 538973e394
1 changed files with 2 additions and 2 deletions

View File

@ -183,8 +183,8 @@ private static Vector2 rotatePointAroundOrigin(Vector2 point, Vector2 origin, fl
point.Y -= origin.Y;
Vector2 ret;
ret.X = (float)(point.X * Math.Cos(MathUtils.DegreesToRadians(angle)) + point.Y * Math.Sin(angle / 180f * Math.PI));
ret.Y = (float)(point.X * -Math.Sin(MathUtils.DegreesToRadians(angle)) + point.Y * Math.Cos(angle / 180f * Math.PI));
ret.X = point.X * MathF.Cos(MathUtils.DegreesToRadians(angle)) + point.Y * MathF.Sin(angle / 180f * MathF.PI);
ret.Y = point.X * -MathF.Sin(MathUtils.DegreesToRadians(angle)) + point.Y * MathF.Cos(angle / 180f * MathF.PI);
ret.X += origin.X;
ret.Y += origin.Y;