title: Draw An Arc In opengl
body: <p>I need a function to draw an arc in opengl.
  I also need a sample code for using it.</p>
  
  <p>i can draw a circle with Lines,i want to draw arc with Line too.
  This is My Function for drawing circule : </p>
  
  <pre><code>void DrawCircle(float cx, float cy, float r, int num_segments) 
  { 
      glBegin(GL_LINE_STRIP); 
      for(int ii = 0; ii &lt; num_segments; ii++) 
      { 
          float theta = 2.0f * 3.1415926f * float(ii) / float(num_segments);//get the current angle 
  
          float x = r * cosf(theta);//calculate the x component 
          float y = r * sinf(theta);//calculate the y component 
  
          glVertex2f(x + cx, y + cy);//output vertex 
      } 
      glEnd(); 
  }
  </code></pre>
  
  <p>I used LINE_STRIP for Concert the code to Drawing an arc but didn't work.
  Does anyone can help me?</p>