public void drawFunction(WindowAndDataProvider windowAndDataProvider, Graphics g, double domainLeft, double domainRight)
	{
		if(visible == true)
		{
    		DPoint p1, p2;
    		int j1, j2;
    		
    		p1 = new DPoint();
    		p2 = new DPoint();
    		g.setColor(color);
    		
    		j1 = 0;
    		
    		while(points.get(j1).getX()<=domainLeft && j1 < points.size()-1)
    		{
    			j1++;
    		}
    		
    		j1--;
    		
    		j2 = j1;
    		
    		while(points.get(j2).getX()<=domainRight && j2 < points.size()-1)
    		{
    			j2++;
    		}
    		
    		for(int i=j1; i<j2; i++)
    		{
    			if(points.size()-1 != i)
    			{
    				p1 = windowAndDataProvider.toCoordinationPoint(points.get(i));
    				p2 = windowAndDataProvider.toCoordinationPoint(points.get(i+1));
    			}
    			else
    			{
    				p1 = windowAndDataProvider.toCoordinationPoint(points.get(i));
    				p2 = windowAndDataProvider.toCoordinationPoint(points.get(i));
    			}
    			
    			g.drawLine((int) Math.round(p1.getX()), (int) Math.round(p1.getY()), (int) Math.round(p2.getX()), (int) Math.round(p2.getY()));
    		}
		}
	}