public static List<Point> getPointsOnLine (LineEquation line)
    {
    	List<Point> ps = new ArrayList<Point>();
    	// x = ay + b
    	if (line.isX())
    	{
    		double y1 = line.getStart().y;
			double y2 = line.getEnd().y;
			if (line.getStart().y > line.getEnd().y) {
				y1 = line.getEnd().y;
				y2 = line.getStart().y ;
			}
			double x = line.getStart().x;
			for (double j = y1; j <= y2; j++) {
				Point point = new Point((int) x, (int) j);
				ps.add(point);
			}
    	}
    	
    	// y = ax + b
    	else
    	{
    		double x1 = line.getStart().x;
			double x2 = line.getEnd().x;
			double a = line.getA();
			double b = line.getB();
			for (double j = x1; j <= x2; j++) {
				double y = a * j + b;
				Point point = new Point((int) j, (int) y);
				ps.add(point);
			}
    	}
    	
    	return ps;
    }