//sap- public List <DataPoint> line_to_points(line l, int size, List <float> x, List <float> y) { List <DataPoint> line_p = new List <DataPoint>(); for (int i = 0; i < size; i++) { line_p.Add(new DataPoint(x[i], l.f(x[i]))); line_p.Add(new DataPoint(l.g(y[i]), y[i])); } return(line_p); }
/*public float dev(Point p , List<Point> points) * { * Line l = linear_reg(points); * return dev(p, l); * }*/ public float dev(point p, line l) { return(Math.Abs(p.y - l.f(p.x))); }