title: How to draw parabolas in C#?
body: <p>I'm working on a numerical analysis project and I want to draw graphics and parabolas on the form. Simply I want to draw a parabola like <code>x² - 2x - 1</code>. So, how can I do that?</p>
  
  <p>Example code:</p>
  
  <pre><code>g = this.CreateGraphics();
  p = new Pen(Brushes.WhiteSmoke,1);
  s = new SolidBrush(Color.Blue);
  
  g.DrawString("x", this.Font, s, x1, y0 + 10);
  g.DrawString("y", this.Font, s, x0 - 5, y2 - 20);
  g.DrawRectangle(p, 400, 100, 300, 300);
  
  for (int i = 0; i &lt; 300; i += 30)
  {
      line(400, 100 + i, 700, 100 + i);
  }
  
  public void line(int x, int y, int x1, int y1)
  {
      g = this.CreateGraphics();
      p = new Pen(Brushes.Gray, 1);
      g.DrawLine(p, x, y, x1, y1);
      g.Dispose();
  }
  </code></pre>