drone
thatcosmonaut 2019-10-31 16:01:15 -07:00
parent d27b5c55d3
commit 7da0aca6b9
2 changed files with 3 additions and 13 deletions

View File

@ -1,10 +0,0 @@
namespace MoonTools.Core.Structs
{
public static class MathHelper
{
public static double ToRadians(double angle)
{
return (System.Math.PI / 180) * angle;
}
}
}

View File

@ -47,10 +47,10 @@ namespace Tests
[Test]
public void Compose()
{
var transformA = new Transform2D(new Position2D(4, 1), 5f, new Vector2(3, 1));
var transformB = new Transform2D(new Position2D(15, 2), 12f, new Vector2(1, 2));
var transformA = new Transform2D(new Position2D(4, 1), (float)System.Math.PI / 2, new Vector2(3, 1));
var transformB = new Transform2D(new Position2D(15, 2), (float)System.Math.PI / 4, new Vector2(1, 2));
transformA.Compose(transformB).Should().BeEquivalentTo(new Transform2D(new Position2D(19, 3), 17f, new Vector2(3, 2)));
transformA.Compose(transformB).Should().BeEquivalentTo(new Transform2D(new Position2D(19, 3), 3 * (float)System.Math.PI / 4, new Vector2(3, 2)));
}
}
}