计算机第四题——绘制三角函数图像
gz0606吧
全部回复
仅看楼主
level 1
叁水 楼主
这里只是编程部分,实际操作应该都不难Dim x0, y0 As IntegerPrivate Sub Command1_Click()ClsCommand1.Enabled = FalseCommand2.Enabled = FalseEnd SubPrivate Sub Command2_Click()a = Text1.Textb = Text2.Textc = Text3.TextFor X = 0 To 2 * 3.14 Step 3.14 / 180Y = a * Sin(b * X + c)PSet (x0 + X * 500, y0 - Y * 500)Next XCommand1.Enabled = TrueEnd SubPrivate Sub Form_Load()Label1.Caption = "用鼠标单击窗口中一点,以确定坐标位置,然后输入abc各值"Command1.Enabled = FalseCommand2.Enabled = FalseEnd SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Clsx0 = Xy0 = YLine (x0 - 500, y0)-(x0 + 3500, y0)Line (x0 + 3400, y0 - 50)-(x0 + 3500, y0)Line (x0 + 3400, y0 + 50)-(x0 + 3500, y0)Line (x0, y0 + 1000)-(x0, y0 - 1000)Line (x0 - 50, y0 - 900)-(x0, y0 - 1000)Line (x0 + 50, y0 - 900)-(x0, y0 - 1000)Command1.Enabled = FalseCommand2.Enabled = TrueEnd Sub
2007年05月26日 07点05分 1
1