javawaveformsine-wave

Create Vertical Sine wave


I am developing a game which uses sine wave. I made use of the horizontal sin wave with the following example http://www.roseindia.net/java/example/java/swing/create_sine_wave.shtml

How do create a similar kind of wave vertically?


Solution

  • Where it says

    g.drawLine(x1, y1, x2, y2);
    

    swap the order of x and y values.