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); }
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); }
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); }
public static void IntersectionOnBothLinesFail(LineD a, LineD b, PointD result) { var intersection = a.IntersectionAndOnBothLines(b, true); intersection.HasValue.Should().BeFalse(); }
public static void IntersectionOnBothLinesFail(LineD a, LineD b, PointD result) { var intersection = a.IntersectionAndOnBothLines(b, true); intersection.HasValue.Should().BeFalse(); }
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; }