Quite simple, the X is a for loop form -300 to 300
(or 0 to 600, minus 300)
the Y axis is sin(x)*max_y_deviation.
You'll have to adjust the x in sin(x) because sin(3.14) is already 1, so your sin will go up and down in 6 pixels along the x axis.
The basic idea is this (untested):
for ($x=-300;$x<300;$x++)
{
$y=150+sin(x/50);
plot a pixel at ($x,$y);
};