Program code geeks only thanks

cancel the request google saved the day

'pythagorean theorem
Public Shared Function Pythagorean_GetDistance(ByVal x1 As Double, ByVal x2 As Double, ByVal y1 As Double, ByVal y2 As Double) As Double
'pythagorean theorem c^2 = a^2 + b^2
'thus c = square root(a^2 + b^2)
Dim a As Double = CDbl(x2 - x1)
Dim b As Double = CDbl(y2 - y1)

Return Math.Sqrt(a * a + b * b)
End Function
 
Back
Top