use GD::Simple;
$i = GD::Simple->new(400,400);
($x1,$y1) = (0,0);
for ($x2=0; $x2<=400; $x2+=10) {
$y2 = sin($x2)*400;
$i->moveTo($x1,$y1);
$i->lineTo($x2,$y2);
($x1,$y1) = ($x2,$y2);
}
print $i->png;
How do I get right value for y2? Thank. In reply to Make sin wave with GD by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |