[RESOLVED] The length of a line
I am sure there's a simple way to do this, but I want to calculate exactly how long a line is based on the x/y co-ordinates of both points. For instance, if a line was from 1,1 to 1,10 it would obviously be 10, but I need to know how to calculate it if it was 1,1 to 3,10 or 1,1 to 7,9.
I'll be working with larger numbers than this, probably in their thousands...it'll calculate the distance between two points on a VB form...but that shouldn't make much difference :-)
Has anyone got a function for returning the result distance between two x,y co-ordinates?
Re: [RESOLVED] The length of a line
By the way, there are ways to make quick and dirty approximations of that length that can be considerably faster in C/C++, but when I tried the same approximations in VB.NET, I got no performance boost, so not only is the Pythagorean Theorem the way to get the precise value, it is also, at least in VB.NET, the fastest way to get a good value, so you might as well just use it.