⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form4.frm

📁 一款电场线的教学软件可以自定义电荷多少
💻 FRM
📖 第 1 页 / 共 2 页
字号:
        qy = y - 10
        For m = 0 To 100
            dxx = DX(Picture1.ScaleWidth / 2 - 1500, Picture1.ScaleHeight / 2 - 100, Picture1.ScaleWidth / 2 + 1500, Picture1.ScaleHeight / 2 - 100, qx, qy, 5)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 1500, Picture1.ScaleHeight / 2 + 100, Picture1.ScaleWidth / 2 + 1500, Picture1.ScaleHeight / 2 + 100, qx, qy, 5)
            dyy = DY(Picture1.ScaleWidth / 2 - 1500, Picture1.ScaleHeight / 2 - 100, Picture1.ScaleWidth / 2 + 1500, Picture1.ScaleHeight / 2 - 100, qx, qy, 5)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 1500, Picture1.ScaleHeight / 2 + 100, Picture1.ScaleWidth / 2 + 1500, Picture1.ScaleHeight / 2 + 100, qx, qy, 5)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx + ddxx
            qy = qy + ddyy
            Picture1.PSet (qx, qy), QBColor(1)
        Next m
        x = x + 150
    Loop
    
    x = Picture1.ScaleWidth / 2 - 1650
    y = Picture1.ScaleHeight / 2 + 100
    Do While x - Picture1.ScaleWidth / 2 - 1500 <> 150
        qx = x
        qy = y + 10
        For m = 0 To 100
            dxx = DX(Picture1.ScaleWidth / 2 - 1500, Picture1.ScaleHeight / 2 - 100, Picture1.ScaleWidth / 2 + 1500, Picture1.ScaleHeight / 2 - 100, qx, qy, 5)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 1500, Picture1.ScaleHeight / 2 + 100, Picture1.ScaleWidth / 2 + 1500, Picture1.ScaleHeight / 2 + 100, qx, qy, 5)
            dyy = DY(Picture1.ScaleWidth / 2 - 1500, Picture1.ScaleHeight / 2 - 100, Picture1.ScaleWidth / 2 + 1500, Picture1.ScaleHeight / 2 - 100, qx, qy, 5)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 1500, Picture1.ScaleHeight / 2 + 100, Picture1.ScaleWidth / 2 + 1500, Picture1.ScaleHeight / 2 + 100, qx, qy, 5)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx + ddxx
            qy = qy + ddyy
            Picture1.PSet (qx, qy), QBColor(1)
        Next m
        x = x + 150
    Loop
    
End Sub

Private Sub Tangular()
    Picture1.DrawWidth = 2
    Label1.Caption = "三角形导体周围的电场线分布情况"
    Picture1.Line (Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000)-(Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600), QBColor(2)
    Picture1.Line (Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600)-(Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600), QBColor(2)
    Picture1.Line (Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600)-(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000), QBColor(2)
    Dim dxx, dyy, qx, qy, ddxx, ddyy As Double
    Dim m, ds As Integer
    ds = 50
    
    x = Picture1.ScaleWidth / 2
    y = Picture1.ScaleHeight / 2 - 1000
    Do While x - Picture1.ScaleWidth / 2 + 800 <> -50
        qx = x
        qy = y - 10
        For m = 0 To 80
            dxx = DX(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dxx = dxx + DX(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = DY(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = dyy + DY(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx + ddxx
            qy = qy + ddyy
            Picture1.PSet (qx, qy), QBColor(1)
        Next m
        x = x - 50
        y = (-2) * (x - Picture1.ScaleWidth / 2) + Picture1.ScaleHeight / 2 - 1000
    Loop

    x = Picture1.ScaleWidth / 2 - 800
    y = Picture1.ScaleHeight / 2 + 600
    Do While x - Picture1.ScaleWidth / 2 - 800 <> 100
        qx = x
        qy = y + 10
        For m = 0 To 80
            dxx = DX(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dxx = dxx + DX(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = DY(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = dyy + DY(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx + ddxx
            qy = qy + ddyy
            Picture1.PSet (qx, qy), QBColor(1)
        Next m
        x = x + 100
    Loop

    x = Picture1.ScaleWidth / 2
    y = Picture1.ScaleHeight / 2 - 1000
    Do While x - Picture1.ScaleWidth / 2 - 800 <> 50
        qx = x
        qy = y - 10
        For m = 0 To 80
            dxx = DX(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dxx = dxx + DX(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = DY(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 800, Picture1.ScaleHeight / 2 + 600, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            dyy = dyy + DY(Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2 - 1000, Picture1.ScaleWidth / 2 + 800, Picture1.ScaleHeight / 2 + 600, qx, qy, 5)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx + ddxx
            qy = qy + ddyy
            Picture1.PSet (qx, qy), QBColor(1)
        Next m
        x = x + 50
        y = (2) * (x - Picture1.ScaleWidth / 2) + Picture1.ScaleHeight / 2 - 1000
    Loop

End Sub

Private Sub jdtj1()
    Label1.Caption = "静电透镜1的演示(左边导体有限)"
    Picture1.Line (Picture1.ScaleWidth / 2 - 2500, Picture1.ScaleHeight / 2 - 1500)-(Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 + 1500), QBColor(2), BF
    Picture1.Line (Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500)-(Picture1.ScaleWidth / 2 - 450, Picture1.ScaleHeight / 2 - 500), QBColor(2), BF
    Picture1.Line (Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500)-(Picture1.ScaleWidth / 2 - 450, Picture1.ScaleHeight / 2 + 1500), QBColor(2), BF
    ds = 50
    
    x = Picture1.ScaleWidth / 2 - 2400
    y = Picture1.ScaleHeight / 2 - 1500
    Do While y - Picture1.ScaleHeight / 2 - 1500 <> 50
        qx = x
        qy = y
        For m = 0 To 150
            dxx = DX(Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 + 1500, qx, qy, 10)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 500, qx, qy, -2)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 1500, qx, qy, -2)
            dyy = DY(Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 + 1500, qx, qy, 10)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 500, qx, qy, -2)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 1500, qx, qy, -2)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx + ddxx
            qy = qy + ddyy
            Picture1.PSet (qx, qy), QBColor(12)
        Next m
        y = y + 50
    Loop
    
    x = Picture1.ScaleWidth / 2 - 2400
    y = Picture1.ScaleHeight / 2 - 1500
    Do While x <> Picture1.ScaleWidth / 2
        qx = x
        qy = y
        For m = 0 To 150
            dxx = DX(Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 + 1500, qx, qy, 10)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 500, qx, qy, -2)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 1500, qx, qy, -2)
            dyy = DY(Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 + 1500, qx, qy, 10)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 500, qx, qy, -2)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 1500, qx, qy, -2)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx - ddyy
            qy = qy + ddxx
            Picture1.PSet (qx, Picture1.ScaleHeight - qy), QBColor(5)
            Picture1.PSet (qx, qy), QBColor(5)
        Next m
        x = x + 200
    Loop
End Sub
Private Sub jdtj2()
    Label1.Caption = "静电透镜2的演示(左边导体无限)"
    Picture1.Line (Picture1.ScaleWidth / 2 - 2500, Picture1.ScaleHeight / 2 - 1500)-(Picture1.ScaleWidth / 2 - 2450, Picture1.ScaleHeight / 2 + 1500), QBColor(2), BF
    Picture1.Line (Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500)-(Picture1.ScaleWidth / 2 - 450, Picture1.ScaleHeight / 2 - 500), QBColor(2), BF
    Picture1.Line (Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500)-(Picture1.ScaleWidth / 2 - 450, Picture1.ScaleHeight / 2 + 1500), QBColor(2), BF
    ds = 50
    j = 0.3
    q = -2.6
    x = Picture1.ScaleWidth / 2 - 2400
    y = Picture1.ScaleHeight / 2 - 1500
    Do While y - Picture1.ScaleHeight / 2 - 1500 <> 50
        qx = x
        qy = y
        For m = 0 To 150
            dxx = j / (qx - Picture1.ScaleWidth / 2 + 2450)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 500, qx, qy, q)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 1500, qx, qy, q)
            dyy = 0
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 500, qx, qy, q)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 1500, qx, qy, q)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx + ddxx
            qy = qy + ddyy
            Picture1.PSet (qx, qy), QBColor(12)
        Next m
            y = y + 50
    Loop
    
    x = Picture1.ScaleWidth / 2 - 2400
    y = Picture1.ScaleHeight / 2 - 1500
    Do While x <> Picture1.ScaleWidth / 2 + 200
        qx = x
        qy = y
        For m = 0 To 150
            dxx = j / (qx - Picture1.ScaleWidth / 2 + 2450)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 500, qx, qy, q)
            dxx = dxx + DX(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 1500, qx, qy, q)
            dyy = 0
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 1500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 - 500, qx, qy, q)
            dyy = dyy + DY(Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 500, Picture1.ScaleWidth / 2 - 500, Picture1.ScaleHeight / 2 + 1500, qx, qy, q)
            ddxx = ds * dxx / Sqr(dxx ^ 2 + dyy ^ 2)
            ddyy = ds * dyy / Sqr(dxx ^ 2 + dyy ^ 2)
            qx = qx - ddyy
            qy = qy + ddxx
            Picture1.PSet (qx, Picture1.ScaleHeight - qy), QBColor(5)
            Picture1.PSet (qx, qy), QBColor(5)
        Next m
        If x > Picture1.ScaleWidth / 2 - 400 Then
            x = x + 50
        Else
            x = x + 200
        End If
    Loop
End Sub

Private Sub Form_Unload(Cancel As Integer)
    End
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -