void  drawGear(float radius, Vec2d center,int teeth,float toothSize){

 Vec2d cp; //circle points as vector

 int points = 400;

 int nTeeth = (points/teeth)/2; // gets number of teeth

 glBegin(GL_LINE_LOOP);

 for (int i = 0; i<points; i++){//number of points (x) x/number gives number of arcs how many points are in one arc of 360

   int x =i; // watch the is

   float angle = ((2*PI)/points)*i; //2*pi is 360 divided into degree segments based on points multiplied by what point your on

   //printf( "%d \n", (x/10)%4 );

   int y = (x/nTeeth)%2; //x/1 gives number of pixels you get a whole number from in regards to the number of pixels x/x =1 every point gets a integer remander

   y = y*toothSize; // increase amplitude from one

   cp.x= cos(angle) * (radius + y);  //gets the length of x in unit circle and muiltiplies by radius the size out

   cp.y= sin(angle) * (radius + y);  //gets the length of y and muiltiplies by radius

   cp = cp+center; //sets the offset center point

   glColor3f( (mouseX/windowW),(mouseY/windowH),0.0f);

   glVertex2f(cp.x,cp.y);

    }

 glEnd( );

  }