---
title: "Draw an egg(2)"
author: "cjc"
date: "2008-12-12T00:23:00Z"
tags: []
slug: "draw-an-egg-2"
draft: false
lastmod: "2008-12-12T00:23:00Z"
id: 299038
url: "https://cjc.iteye.com/blog/299038"
---

It's also easy to draw an egg with the curve y^2=(sin(x)\*(1+cos(x)/π)).

 

01. Private Sub Form\_Click()
02. Me.Caption = "Draw an egg"
03. Dim pi As Single, X As Single
04. pi = 4 * Atn(1)
05. Me.Scale (-1, -2)-(4, 2)
06. For X = 0 To pi Step 0.0005
07. Me.Circle (X, -Sqr(Sin(X) * (1 + Cos(X) / pi))), 0.01, vbWhite
08. Me.Circle (X, Sqr(Sin(X) * (1 + Cos(X) / pi))), 0.01, vbWhite
09. Next
10. End Sub

 

 

It returns:

 

![](http://p.blog.csdn.net/images/p_blog_csdn_net/northwolves/EntryImages/20081212/egg2.JPG)