コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public void Property_CounterClockwiseAngleTo_IsNonNegative(Direction2D direction1, Direction2D direction2)
 {
     direction1.To3D().CounterClockwiseAngleTo(direction2.To3D()).Should().BeGreaterOrEqualTo(ZeroAngle);
 }
コード例 #4
0
 public void Property_SignedAngleTo_DoesNotExceedStraightAngle(Direction2D direction1, Direction2D direction2)
 {
     direction1.To3D().SignedAngleTo(direction2.To3D())
     .Should()
     .BeLessOrEqualTo(StraightAngle);
 }