protected override void InternalVisualize(TestCaseUI ui) { ui.Log("D = " + distance); ui.Log("V = " + v); // Горизонт ui.Line(-100, 0, 100, 0, new Pen(Color.Black, 3)); // Цель ui.Circle(50, 0, 2, new Pen(Color.Blue, 1)); if (LastException == null) { //Траектория foreach (var dot in trajectory.Where((p, i) => i % 10 == 0)) { ui.Dot(-50 + dot.Item1 * 100 / distance, -dot.Item2 * 100 / distance, Color.Red); } ui.Circle(-50, 0, 1, new Pen(Color.Black, 5)); if (trajectory.Any()) { // Пушка ui.Line(-50, 0, -50 + 10 * Math.Cos(angle), -10 * Math.Sin(angle), new Pen(Color.Black, 3)); ui.Log("Угол прицеливания: " + 180 * angle / Math.PI + "°"); ui.Log("Высота над целью = " + trajectory.Last().Item2); ui.Log("Время снаряда в полете = " + time); } } }
protected override void InternalVisualize(TestCaseUI ui) { ui.Log("Wall inclanation: " + ToGradus(wallInclanation)); ui.Log("Direction: " + ToGradus(initialDirection)); ui.Line(-100 * Math.Cos(wallInclanation), 100 * Math.Sin(wallInclanation), 100 * Math.Cos(wallInclanation), -100 * Math.Sin(wallInclanation), new Pen(Color.Black, 1)); ui.Line(-50 * Math.Cos(initialDirection), 50 * Math.Sin(initialDirection), 0, 0, new Pen(Color.Red, 3)); ui.Line(50 * Math.Cos(angle), -50 * Math.Sin(angle), 0, 0, new Pen(Color.Red, 3) { DashStyle = DashStyle.Dash }); ui.Line(50 * Math.Cos(expectedFinalDirection), -50 * Math.Sin(expectedFinalDirection), 0, 0, new Pen(Color.Green, 1) { DashStyle = DashStyle.Dash }); }
protected override void InternalVisualize(TestCaseUI ui) { ui.Log("Calculated area: " + calculatedArea); ui.Log("Calculated isConvex: " + calculatedIsConvex); ui.Log("Expected area: " + area); ui.Log("Expected isConvex: " + isConvex); ui.Rect(new Rectangle(-90, -90, 180, 180), new Pen(Color.FromArgb(50, Color.Green), 1)); Action <PointF> plot = p => ui.Circle(p.X, p.Y, 3, neutralPen); PointF prev = scaledPoints.Last(); foreach (var curr in scaledPoints) { plot(curr); ui.Line(prev.X, prev.Y, curr.X, curr.Y, neutralThinPen); prev = curr; } }
protected override void InternalVisualize(TestCaseUI ui) { ui.Line(-100, 0, 100, 0, neutralThinPen); ui.Line(0, -100, 0, 100, neutralThinPen); ui.Line(a.X, a.Y, b.X, b.Y, neutralPen); ui.Circle(a.X, a.Y, 1, neutralPen); ui.Circle(b.X, b.Y, 1, neutralPen); ui.Circle(x.X, x.Y, 3, neutralPen); ui.Circle(x.X, x.Y, answer, new Pen(actualAnswerPen.Color, 1) { DashStyle = DashStyle.Custom, DashPattern = new float[] { 4, 4 } }); ui.Log("A = " + a); ui.Log("B = " + b); ui.Log("X = " + x); ui.Log("Expected distance " + distance); ui.Log("Calculated distance: {0}", answer); }
protected override void InternalVisualize(TestCaseUI ui) { ui.Rect(new System.Drawing.Rectangle(r1.Left, r1.Top, r1.Width, r1.Height), neutralPen); ui.Rect(new System.Drawing.Rectangle(r2.Left, r2.Top, r2.Width, r2.Height), neutralPen); ui.Log("r1: {0}", r1); ui.Log("r2: {0}", r2); ui.Log("Solution: "); ui.Log(" intersected: {0} {1}", intersectedAnswer, intersected != intersectedAnswer ? "wrong!" : ""); ui.Log(" intersection square: {0} {1}", intersectionSquareAnswer, intersectionSquare != intersectionSquareAnswer ? "wrong!" : ""); ui.Log(" index of inner rectangle: {0} {1}", indexOfInnerRectAnswer, indexOfInnerRectangle != indexOfInnerRectAnswer ? "wrong!" : ""); }
protected override void InternalVisualize(TestCaseUI ui) { ui.Rect(r1, neutralPen); ui.Rect(r2, neutralPen); ui.Log("r1: {0}", r1); ui.Log("r2: {0}", r2); ui.Log("Solution: "); ui.Log(" intersected: {0} {1}", intersectedAnswer, intersected != intersectedAnswer ? "wrong!" : ""); ui.Log(" intersection square: {0} {1}", intersectionSquareAnswer, intersectionSquare != intersectionSquareAnswer ? "wrong!" : ""); ui.Log(" index of inner rectangle: {0} {1}", indexOfInnerRectAnswer, indexOfInnerRectangle != indexOfInnerRectAnswer ? "wrong!" : ""); }
protected override void InternalVisualize(TestCaseUI ui) { // Добавляет оси координат: // - красная — OY // - зеленая — OX ui.Line(0, 0, 0, 50, actualAnswerPen); ui.Line(0, 0, 50, 0, expectedAnswerPen); ui.Rect(new System.Drawing.Rectangle(r1.Left, r1.Top, r1.Width, r1.Height), neutralPen); ui.Rect(new System.Drawing.Rectangle(r2.Left, r2.Top, r2.Width, r2.Height), neutralPen); ui.Log("r1: {0}", r1); ui.Log("r2: {0}", r2); ui.Log("Solution: "); ui.Log(" intersected: {0} {1}", intersectedAnswer, intersected != intersectedAnswer ? "wrong!" : ""); ui.Log(" intersection square: {0} {1}", intersectionSquareAnswer, intersectionSquare != intersectionSquareAnswer ? "wrong!" : ""); ui.Log(" index of inner rectangle: {0} {1}", indexOfInnerRectAnswer, indexOfInnerRectangle != indexOfInnerRectAnswer ? "wrong!" : ""); }