float addWave(float _amp, float _sampleRate, int _i){ // draws sine waves



float position = _i; // this is the x thats used 

float offset = _amp * d_sin(( position/_sampleRate)*360); // this doesn't return x this gives a ratio of how often it gets sampled

        //gives position of rotation

return offset;


}


void drawWaveLine(int _i){

_i = _i-1;//toget rid of point at front

float strokewidthc = 500; // how much to times vector

float strokewidthd = 10; // how much to times vector  

Vec2d a = drawLinePoints[_i];// point 1

Vec2d b = drawLinePoints[_i+1]; // point 2

  

  Vec2d v = b-a; // get vector minus two point vects

  Vec2d vp;

  

  vp.x = v.y *-1.0;// times by inverse cosine is inversly proportional to sine

  vp.y = v.x;

  

  vp.normalize();

  //here mess with c or d stroke point for one side

   strokewidthc = addWave(50, 20 ,_i);

  // printf( "%f hello \n", strokewidthc );

  Vec2d c = (a+vp * strokewidthc);

  Vec2d d = (a-vp * strokewidthd);

  glVertex2f(c.x, c.y); // puts points

  

  

}