小说网 找小说 无限小说 烟雨红尘 幻想小说 酷文学 深夜书屋

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:

 

posted on 2008-12-12 00:23  王峰炬  阅读(124)  评论(0编辑  收藏  举报

导航