Draw an egg(2)

It's also easy to draw an egg with the curve y^2=(sin(x)*(1+cos(x)/π)).
 
  1. Private Sub Form_Click()
  2. Me.Caption = "Draw an egg"
  3. Dim pi As Single, X As Single
  4. pi = 4 * Atn(1)
  5. Me.Scale (-1, -2)-(4, 2)
  6. For X = 0 To pi Step 0.0005
  7. Me.Circle (X, -Sqr(Sin(X) * (1 + Cos(X) / pi))), 0.01, vbWhite
  8. Me.Circle (X, Sqr(Sin(X) * (1 + Cos(X) / pi))), 0.01, vbWhite
  9. Next
  10. End Sub

 

It returns:

原文地址:https://www.cnblogs.com/fengju/p/6336241.html