1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Sub projOrth(ByRef xa As Object, ByRef YA As Object, ByRef xb As Object, ByRef yb As Object, ByRef xm As Object, ByRef ym As Object, ByRef xh As Object, ByRef yh As Object, ByRef mh As Object)
Dim mh2 As Object
Dim ah As Object
Dim ab As Object
Dim am2 As Object
Dim ab2 As Object
Dim bm2 As Object
bm2 = (xm - xb) ^ 2 + (ym - yb) ^ 2
ab2 = (xa - xb) ^ 2 + (YA - yb) ^ 2
am2 = (xm - xa) ^ 2 + (ym - YA) ^ 2
ab = System.Math.Sqrt(ab2)
ah = (bm2 - ab2 - am2) / (-2 * ab) '''PRINT "ah="; ah
xh = ((xb - xa) * ah / ab) + xa
yh = ((yb - YA) * ah / ab) + YA
mh2 = (yh - ym) ^ 2 + (xh - xm) ^ 2
mh = System.Math.Sqrt(mh2)
End Sub |
Partager