文件名称:已知ABC三点坐标,得到A点到BC的最近距离
文件大小:79KB
文件格式:ZIP
更新时间:2021-11-23 06:44:41
VB.net 点到直线 源代码
已知ABC三点坐标,得到A点到BC的最近距离。 VB.net源代码 VS2012开发环境 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim A_x As Double = Me.TextBox_AX.Text Dim A_y As Double = Me.TextBox_AY.Text Dim B_x As Double = Me.TextBox_BX.Text Dim B_y As Double = Me.TextBox_BY.Text Dim C_x As Double = Me.TextBox_CX.Text Dim C_y As Double = Me.TextBox_CY.Text Dim Gsz_dis As Double If A_x = B_x Then Gsz_dis = Math.Abs(C_x - A_x) Else Dim Line_K As Double = (B_y - A_y) / (B_x - A_x) Dim Line_C As Double = (B_x * A_y - A_x * B_y) / (B_x - A_x) Gsz_dis = Math.Abs(Line_K * C_x - C_y + Line_C) / (Math.Sqrt(Line_K * Line_K + 1)) End If Me.TextBox_Result.Text = Gsz_dis End Sub
【文件预览】:
WindowsApplication1
----WindowsApplication1.v11.suo(20KB)
----WindowsApplication1.sln(947B)
----WindowsApplication1()
--------Form1.vb(845B)
--------bin()
--------obj()
--------My Project()
--------WindowsApplication1.vbproj.user(143B)
--------Form1.resx(6KB)
--------Form1.Designer.vb(5KB)
--------WindowsApplication1.vbproj(5KB)
--------App.config(186B)