public static void draw_line(d2 point1, d2 point2, PictureBox p, Graphics g) { point1.x = point1.X * E1[0] + point1.Y * E2[0]; point1.y = point1.X * E1[1] + point1.Y * E2[1]; point2.x = point2.X * E1[0] + point2.Y * E2[0]; point2.y = point2.X * E1[1] + point2.Y * E2[1]; g.DrawLine(Pens.Black, (float)point1.x + p.Width / 2, (float)point1.y + p.Height / 2, (float)point2.x + p.Width / 2, (float)point2.y + p.Height / 2); }
public static void draw_basis(PictureBox p, Graphics g) { d2 x = new d2(100 * E1[0], 100 * E1[1]); d2 y = new d2(100 * E2[0], 100 * E2[1]); d2 zero = new d2(0, 0); draw_line_color(zero, x, p, g, Color.Red); draw_line_color(zero, y, p, g, Color.Green); }
static void draw_line_color(d2 point1, d2 point2, PictureBox p, Graphics g, Color col) { Pen pn = new Pen(col); g.DrawLine(pn, (float)point1.X + p.Width / 2, (float)point1.Y + p.Height / 2, (float)point2.X + p.Width / 2, (float)point2.Y + p.Height / 2); }
public static void draw_point(d2 point, PictureBox p, Graphics g) {//отображение точки на пикчерБоксе point.x = point.X * E1[0] + point.Y * E2[0]; point.y = point.X * E1[1] + point.Y * E2[1]; g.FillEllipse(Brushes.Black, (float)point.x + p.Width / 2, (float)point.y + p.Height / 2, point.Size, point.Size); }