public override double[] GetEquation(Shape shape, CoordinateSystemInteractor coordinate) { var line = shape as Line; Point startPoint = new Point(line.X1, line.Y1); Point endPoint = new Point(line.X2, line.Y2); var firstPoint = coordinate.GetPoint(startPoint); var lastPoint = coordinate.GetPoint(endPoint); double A = firstPoint[1] - lastPoint[1]; double B = lastPoint[0] - firstPoint[0]; double C = firstPoint[0] * lastPoint[1] - lastPoint[0] * firstPoint[1]; return(new double[] { A, B, C }); }
public abstract double[] GetEquation(Shape shape, CoordinateSystemInteractor coordinate);