Last active
March 9, 2016 14:17
-
-
Save bradphelan/7fe21ad8ebfcb43696b8 to your computer and use it in GitHub Desktop.
Test suite for smallest angle between in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void SmallestSignedAngleBetweenShouldWork () | |
{ | |
WMath.SmallestSignedAngleBetween(0.1, 0.2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.1, 0.2+Math.PI*2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.1, 0.2-Math.PI*2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.1+Math.PI*2, 0.2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.1-Math.PI*2, 0.2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.2, 0.1).Should().BeApproximately(-0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.2, 0.1-Math.PI*2).Should().BeApproximately(-0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.2, 0.1+Math.PI*2).Should().BeApproximately(-0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.2+Math.PI*2, 0.1).Should().BeApproximately(-0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.2-Math.PI*2, 0.1).Should().BeApproximately(-0.1, 1e-5); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment