title: Draw sine wave with increasing frequency processing
body: <p>I have the following code that draws a sine wave. 
  see my code below:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>float x, y;
  float prevX=0.0, prevY=0.0;
  int numOfWaves = 6;
  float angle = 0;
  
  void setup()
  {
    size(360, 360);
    background(0);
    smooth();
    stroke(255);
  }
  
  void draw()
  {
    translate(0, height/2);
    scale(1, -1);
  
    for(int count=0; count &lt; 360; ++count){
      x = count;
  
      angle = radians(count);
      y = sin(angle*(numOfWaves/2.0));
  
      y = map(y,-1,1,-height/2,height/2);
  
      line(prevX, prevY, x, y);
  
      prevX = x;
      prevY = y;
    }
  
    prevX = prevY = 0.0;
  }
  </code></pre>
  
  <p>But I would like the frequency of the sine to increase over distance. 
  this is the current sine wave I get:</p>
  
  <p><a href="https://i.stack.imgur.com/6ZwZz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6ZwZz.png" alt="enter image description here"></a></p>
  
  <p>But I want to make it look like this:
  <a href="https://i.stack.imgur.com/ONBlg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ONBlg.png" alt="enter image description here"></a></p>
  
  <p>How would I do this?</p>