using System.Collections.Generic;
static void Main(string[] args)
Random rnd = new Random();
int w = Polygon.GetClientWidth();
int h = Polygon.GetClientHeight();
Point yBottom = new Point(0, -h / 2);
Point yTop = new Point(0, h / 2);
Polygon yAxis = new Polygon(yBottom, yTop);
Point xLeft = new Point(-w / 2, 0);
Point xRight = new Point(w / 2, 0);
Polygon xAxis = new Polygon(xLeft, xRight);
int m = rnd.Next(1, 5), b = rnd.Next(30);
Console.WriteLine("the equation is: y={0}x+{1}", m, b);
Point A = new Point(-w / 2, m * (-w / 2) + b);
Point B = new Point(w / 2, m * (w / 2) + b);
Polygon pA = new Polygon(20, 3);
pA.Move(A.GetX(), A.GetY());
Polygon pB = new Polygon(20, 3);
pB.Move(B.GetX(), B.GetY());
Polygon t = new Polygon(A, B);
Polygon lineCaption = new Polygon(10, 0);
lineCaption.SetCaption("y=" + m + "x+" + b);
lineCaption.Move(-w / 2 + 100, h / 2 - 100);
Point C = new Point(50, m * (50) + b);
Polygon pC = new Polygon(20, 3);
pC.Move(C.GetX(), C.GetY());
Point D = new Point(0, m * (0) + b);
Polygon pD = new Polygon(20, 3);
pD.Move(D.GetX(), D.GetY());
for (int count = 1; count <= 10; count++)
pD.SetBrushColor(System.Drawing.Color.Red);
pD.SetBrushColor(System.Drawing.Color.Yellow);