帮帮忙,跪下谢谢斑竹,VB
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><TR>
<TD width=*>
<P><B>帮帮忙,跪下谢谢斑竹,VB</B></P>
<P>Private Function PrintWord(x, Y, Word As String)
With Picture1
.CurrentX = x
.CurrentY = Y
.ForeColor = RGB(0, 0, 255)
End With
Picture1.Print Word
End Function
'定义画点函数
Private Function DrawDot(Px, Py, Color)
Picture1.PSet (Px, Py), Color
End Function
Sub XY() '建立直角坐标系
Picture1.DrawWidth = 1 '设置线条宽度
Picture1.Cls
'设定用户坐标系,坐标原点在Picture1中心
Picture1.Scale (-10, 10)-(10, -10)
Picture1.Line (-10, 0)-(10, 0), RGB(0, 0, 255)
Picture1.Line -(9.5, 0.5), RGB(0, 0, 255)
Picture1.Line (10, 0)-(9.5, -0.5), RGB(0, 0, 255)
Picture1.ForeColor = RGB(0, 0, 255)
Picture1.Print "X"
'画 X 轴
Picture1.Line (0, -10)-(0, 10), RGB(0, 0, 255)
Picture1.Line -(0.5, 9.5), RGB(0, 0, 255)
Picture1.Line (0, 10)-(-0.5, 9.5), RGB(0, 0, 255)
Picture1.Print "Y"
'画 Y 轴
For lin = -9 To 9
Picture1.Line (lin, 0)-(lin, 0.25)
wor = PrintWord(lin - 0.5, -0.5, Str(lin))
Picture1.Line (0, lin)-(-0.25, lin)
If lin <> 0 Then
wor = PrintWord(-0.9, lin, Str(lin))
End If
Next lin
Picture1.DrawWidth = 1
End Sub
Private Sub cmdPlot_Click()
XY
On Error Resume Next
Dim x As Double, Y As Double
Randomize
SC.Reset
SC.AddCode "Function RunThis(X)" & vbCrLf & "RunThis=" & txtEquation & vbCrLf & "End Function"
For x = -15 To 15 Step 0.001
Y = SC.Run("runthis", x)
DoEvents
Picture1.PSet (x, Y), RGB(250, 0, 0)
Next x
End Sub</P>
<P>Private Sub Command2_Click()
XY
End Sub</P>
<P>Private Sub Command3_Click()
End
End Sub</P>
<P>
Private Sub Form_Load()
Me.Caption = "美丽曲线——数学爱好者"
Me.Show
Me.AutoRedraw = True
XY
End Sub
</P></TD>
<TD align=right width=60></TD></TR></TABLE>
<P>为仕么Y=LOG(X),SQR(X)也有图象(X轴负半轴),sc为ms.script.control控件请帮忙,<B>跪下谢谢斑竹</B></P>
[此贴子已经被作者于2005-3-4 17:40:39编辑过] 回复 1# llm3-1415926
你在搞什么呢?……………………………………………… 楼主这是啥意思啊?不明白你在说什么呢~ 代码写的好不好另当别论,格式一定要好 好帖,确实好帖! 亲,你在写什么啊? 我不得不承认我是有一点VB基础的孩子啊,可是真的完全看不懂
页:
[1]