I want to draw a curve required output like this. But i am getting the output like this current output. Here the blue color is the background & the curve is the red colour. here My code.
for (i = 10; i <= 360; i = i + 10) {
new_x = i;
new_y = (float) Math.sin(new_x / 180.0 * Math.PI);
canvas.drawLine((float) (old_x / 360.0 * w), 100 + 90 * old_y, (float) (new_x / 360.0 * w), 100 + 90 * new_y, paint);
old_x = new_x;
old_y = new_y;
}