Const PI = 3.14'定义圆周率常量
Private Sub Command1_Click()
Dim wtoh As Single'定义picture控件的宽高比
wtoh = Picture1.Width / Picture1.Height
Picture1.Scale (-10 * wtoh, 10)-(10 * wtoh, -10)'y轴设为-10~10,算出x轴范围,画xy轴
Picture1.Line (-10 * wtoh, 0)-(10 * wtoh, 0), vbGreen'
Picture1.Line (0, 10)-(0, -10), vbGreen'
Dim x As Single
Dim y As Single
Dim t As Integer
For t = 0 To 359'按角度循环
x = 8 * Cos(t * PI / 180)'椭圆参数方程高中数学, 角度转弧度,长轴8短轴6
y = 6 * Sin(t * PI / 180)'
Picture1.PSet (x, y), vbBlue
Next
End Sub