public void Property_SignedAngleTo_IsAntiSymmetric(Direction2D direction1, Direction2D direction2) { var angle1 = direction2.To3D().SignedAngleTo(direction1.To3D()); var angle2 = direction1.To3D().SignedAngleTo(direction2.To3D()); if (angle1 == StraightAngle || angle1 == -StraightAngle) { (angle2 == StraightAngle || angle2 == -StraightAngle).Should().BeTrue(); } else { angle1.Should().Be(-angle2); } }
public void Property_CounterClockwiseAngleTo_FlippingTheArgumentsYieldsExplementaryAngle(Direction2D direction1, Direction2D direction2) { var d1 = direction1.To3D(); var d2 = direction2.To3D(); var angle1 = d1.CounterClockwiseAngleTo(d2); var angle2 = d2.CounterClockwiseAngleTo(d1); if (angle1 == ZeroAngle && angle2 == ZeroAngle) { angle1.Should().Be(-angle2); } else { (angle1 + angle2).Should().Be(FullCircle); } }
public void Property_CounterClockwiseAngleTo_IsNonNegative(Direction2D direction1, Direction2D direction2) { direction1.To3D().CounterClockwiseAngleTo(direction2.To3D()).Should().BeGreaterOrEqualTo(ZeroAngle); }
public void Property_SignedAngleTo_DoesNotExceedStraightAngle(Direction2D direction1, Direction2D direction2) { direction1.To3D().SignedAngleTo(direction2.To3D()) .Should() .BeLessOrEqualTo(StraightAngle); }