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

📄 求两直线交点坐标.frm

📁 一个用vb编的程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H0080C0FF&
   Caption         =   "求两直线交点坐标"
   ClientHeight    =   6900
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8505
   Icon            =   "求两直线交点坐标.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   6900
   ScaleWidth      =   8505
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "打坐标"
      Height          =   495
      Left            =   7320
      TabIndex        =   14
      Top             =   3000
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "退出"
      Height          =   495
      Left            =   7320
      TabIndex        =   13
      Top             =   4680
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "求交点坐标"
      Height          =   495
      Left            =   5520
      TabIndex        =   12
      Top             =   5520
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打直线"
      Height          =   495
      Left            =   7320
      TabIndex        =   11
      Top             =   3840
      Width           =   975
   End
   Begin VB.TextBox Text6 
      Height          =   375
      Left            =   7200
      TabIndex        =   10
      Text            =   "Text6"
      Top             =   6120
      Width           =   1095
   End
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   5520
      TabIndex        =   9
      Text            =   "Text5"
      Top             =   6120
      Width           =   1215
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   4080
      TabIndex        =   4
      Text            =   "Text4"
      Top             =   6120
      Width           =   975
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   2760
      TabIndex        =   3
      Text            =   "Text3"
      Top             =   6120
      Width           =   975
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1320
      TabIndex        =   2
      Text            =   "Text2"
      Top             =   6120
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   120
      TabIndex        =   1
      Text            =   "Text1"
      Top             =   6120
      Width           =   855
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00FFFFC0&
      Height          =   5175
      Left            =   120
      ScaleHeight     =   5115
      ScaleWidth      =   6915
      TabIndex        =   0
      Top             =   120
      Width           =   6975
   End
   Begin VB.Label Label5 
      Caption         =   "b2"
      Height          =   375
      Left            =   4080
      TabIndex        =   15
      Top             =   5520
      Width           =   975
   End
   Begin VB.Label Label4 
      Caption         =   "两直线状况"
      Height          =   495
      Left            =   7200
      TabIndex        =   8
      Top             =   5520
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "k2"
      Height          =   375
      Left            =   2760
      TabIndex        =   7
      Top             =   5520
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "b1"
      Height          =   375
      Left            =   1320
      TabIndex        =   6
      Top             =   5520
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "k1"
      Height          =   375
      Left            =   120
      TabIndex        =   5
      Top             =   5520
      Width           =   855
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim x, y, k1, k2, b1, b2


Private Sub Command1_Click()
k1 = Val(Text1.Text)
k2 = Val(Text3.Text)
b1 = Val(Text2.Text)
b2 = Val(Text4.Text)
Picture1.DrawWidth = 3

Picture1.Line (0, Picture1.ScaleHeight / 2 + k1 * Picture1.ScaleWidth / 2 - b1)-(Picture1.ScaleWidth, Picture1.ScaleHeight / 2 - k1 * Picture1.ScaleWidth / 2 - b1), 250
Picture1.Line (0, Picture1.ScaleHeight / 2 + k2 * Picture1.ScaleWidth / 2 - b2)-(Picture1.ScaleWidth, Picture1.ScaleHeight / 2 - k2 * Picture1.ScaleWidth / 2 - b2), 50000

End Sub

Private Sub Command2_Click()
k1 = Val(Text1.Text)
k2 = Val(Text3.Text)
b1 = Val(Text2.Text)
b2 = Val(Text4.Text)
If k1 = k2 And b1 = b2 Then Label4.Caption = "重合"
If k1 = k2 And b1 <> b2 Then Label4.Caption = "平行"
If k1 <> k2 And k1 * k2 <> -1 Then x = (b2 - b1) / (k1 - k2): y = x * k1 + b1: Text5.Text = Str$(x): Text6.Text = Str$(y): Label4.Caption = "相交"
If k1 <> k2 And k1 * k2 = -1 Then x = (b2 - b1) / (k1 - k2): y = x * k1 + b1: Text5.Text = Str$(x): Text6.Text = Str$(y): Label4.Caption = "垂直"




End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Command4_Click()
Picture1.DrawWidth = 1
Picture1.Line (0, Picture1.ScaleHeight / 2)-(Picture1.ScaleWidth, Picture1.ScaleHeight / 2)

Picture1.Line (Picture1.ScaleWidth / 2, 0)-(Picture1.ScaleWidth / 2, Picture1.ScaleHeight)


End Sub

Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""

End Sub

⌨️ 快捷键说明

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