Beispiel #1
0
        public static void IntersectionOnBothLines(LineD a, LineD b, PointD result)
        {
            var intersection = a.IntersectionAndOnBothLines(b, true);

            intersection.HasValue.Should().BeTrue();

            intersection.Value.X.Should().BeApproximately(result.X, 1e-7);
            intersection.Value.Y.Should().BeApproximately(result.Y, 1e-7);
        }
Beispiel #2
0
        public static void IntersectionOnBothLines(LineD a, LineD b, PointD result)
        {
            var intersection = a.IntersectionAndOnBothLines(b, true);

            intersection.HasValue.Should().BeTrue();

            intersection.Value.X.Should().BeApproximately(result.X, 1e-7);
            intersection.Value.Y.Should().BeApproximately(result.Y, 1e-7);
        }
Beispiel #3
0
        private static bool FilterCheckIfTrackForCrossedOldTrack(LineD currentTrack, LineD track, Point currentPosition)
        {
            if (currentPosition == track.A)
            {
                return(true);
            }

            if (currentTrack.IntersectionAndOnBothLines(track, true) != null)
            {
                return(true);
            }

            if (track.IsOnLine(currentPosition, true))
            {
                return(true);
            }

            if (currentTrack.IsOnLine(track.A, true))
            {
                return(true);
            }

            return(false);
        }
Beispiel #4
0
        public static void IntersectionOnBothLinesFail(LineD a, LineD b, PointD result)
        {
            var intersection = a.IntersectionAndOnBothLines(b, true);

            intersection.HasValue.Should().BeFalse();
        }
Beispiel #5
0
        public static void IntersectionOnBothLinesFail(LineD a, LineD b, PointD result)
        {
            var intersection = a.IntersectionAndOnBothLines(b, true);

            intersection.HasValue.Should().BeFalse();
        }
Beispiel #6
0
        private static bool FilterCheckIfTrackForCrossedOldTrack(LineD currentTrack, LineD track, Point currentPosition)
        {
            if (currentPosition == track.A)
            {
                return true;
            }

            if (currentTrack.IntersectionAndOnBothLines(track, true) != null)
            {
                return true;
            }

            if (track.IsOnLine(currentPosition, true))
            {
                return true;
            }

            if (currentTrack.IsOnLine(track.A, true))
            {
                return true;
            }

            return false;
        }