in reply to Re^4: Make sin wave with GD
in thread Make sin wave with GD
The first 200 will shift the center line of the sine so that it is along the center of the plot. The minus sign flips the sine upside down since y is increasing down, not up. Finally, the scale factor is changed to 200 so there is room for both the upper and lower halves of the sine.
That can be written without repeating the 200 as:
$y2 = 200 * (1-sin($x2));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Make sin wave with GD
by Anonymous Monk on Jul 01, 2015 at 18:29 UTC | |
by sn1987a (Curate) on Jul 01, 2015 at 18:56 UTC | |
by Anonymous Monk on Jul 01, 2015 at 19:32 UTC |