VERSION 5.00
Begin VB.Form frmPicture
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "正态分布概率密度图"
ClientHeight = 5595
ClientLeft = 60
ClientTop = 450
ClientWidth = 7470
LinkTopic = "Form1"
ScaleHeight = 5595
ScaleWidth = 7470
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退 出"
Height = 495
Left = 5520
TabIndex = 2
Top = 4920
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "绘 图"
Height = 495
Left = 3840
TabIndex = 1
Top = 4920
Width = 1455
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 4455
Left = 240
ScaleHeight = 7.805
ScaleMode = 0 'User
ScaleWidth = 12.25
TabIndex = 0
Top = 240
Width = 6975
End
End
Attribute VB_Name = "frmPicture"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim I As Double, P As Double
Dim I1 As Double, P1 As Double
Dim I2 As Double, P2 As Double
Dim K As Integer
Private Sub Command1_Click()
Picture1.Line (-8, 0)-(8, 0)
Picture1.Line (0, -9)-(0, 1)
K = 0
For I = -4 To 4 Step 0.1
I1 = I: I2 = I + 0.1
Norm I1, P1
Norm I2, P2
P = (Abs(P1 - P2) / 0.1) * 20
If K = 0 Then
Picture1.CurrentX = 2 * I1
Picture1.CurrentY = -P
Else
Picture1.Line -(2 * I1, -P)
End If
K = K + 1
Next I
End Sub
Private Sub Command2_Click()
Unload Me
End
End Sub
Private Sub Form_Load()
Picture1.Scale (-15, -10)-(15, 5)
End Sub