void AddCoef(Point vertex1, Point vertex2, List <LineEquationCoef> equationCoef) { LineEquationCoef coef = new LineEquationCoef(); coef.kx = (vertex2.y - vertex1.y) / (vertex2.x - vertex1.x); coef.c = (-1 * (vertex1.x * (vertex2.y - vertex1.y) / (vertex2.x - vertex1.x))) + vertex1.y; equationCoef.Add(coef); }
int GetY(LineEquationCoef coef, int x) { double toReturn = (coef.kx * x + coef.c); return((int)Math.Ceiling(toReturn)); }