Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: NBrownohPosted on 2003-11-14 at 22:38:24ID: 9753141
that little function below will measure the length of any line, is that what you are looking for?
Public Function DistanceToLine(X1 As Double, Y1 As Double, X2 As Double, Y2 As Double) As Double
Dim HLen As Double, WLen As Double, TRoot As Double
HLen = Abs(X1 - X2)
WLen = Abs(Y1 - Y2)
HLen = HLen * HLen
WLen = WLen * WLen
TRoot = Sqr(WLen + HLen)
DistanceToLine = TRoot
End Function