Exemple #1
0
        public void IntersectTest_WhenParallelStraightLineNotIntersectsPlane_ThenResultIsEmpty()
        {
            var plane = new Plane3D(new Position3D(100, 100, 0), new Vector3D(0, 0, 1));
            var axis  = new Axis3D(new Position3D(100, 100, 100), new Vector3D(1, 1, 0));

            var(success, intersection)   = plane.Intersect(axis);
            var(success2, intersection2) = axis.Intersect(plane);

            Assert.False(success);
            Assert.False(success2);
        }
Exemple #2
0
        public void IntersectTest_WhenStraightLineYIntersectsPlaneXZ_ThenResultIsIntersection()
        {
            var plane = new Plane3D(new Position3D(0, 100, 0), new Vector3D(0, 1, 0));
            var axis  = new Axis3D(new Position3D(100, 0, 100), new Vector3D(0, 1, 0));

            var(success, intersection)   = plane.Intersect(axis);
            var(success2, intersection2) = axis.Intersect(plane);

            Assert.True(success);
            Assert.Equal(new Position3D(100, 100, 100), intersection);
            Assert.True(success2);
            Assert.Equal(new Position3D(100, 100, 100), intersection2);
        }