djborec
2012-08-22 15:55:34
Can somebody explain me ,how is function Distance in Math working?
Brandon
2012-08-22 15:58:22
Center of what though?
Also there is a function called distance
http://www.purplemath.com/modules/distform.htm
putonajonny
2012-08-22 16:22:54
Distance calculates the distance between the points (hence the name)
It uses Pythagoras:
Result := SQRT(pow((x1 - x2), 2) + pow((y1 - y2), 2))
Chen Monopoly
2012-08-22 16:54:42
It's simple if you know the pythagoras theorem a^2 + b^2 = c^2, or c = sqrt(a^2 + b^2)
The distance formula between two points or coordinates (x1, y1) and (x2, y2) is what putonajonny said because it's simply the same thing as
c or distance in our case = sqrt(a^2 + b^2)
Where a is x2-x1
and b is y2-y1
You're basically creating a right triangle out of the two points and finding out the distance between the two points by solving for the length of the hypotenuse.
Nebula
2012-08-22 17:56:43
Kay here's what it is
A^2 + B^2 = C^2
a and b are the two sides of a triangle that form a right angle. Side c is the diagonal side that connects the ends of sides a and b, forming a triangle. (hypotenuse).
So if you want to find the distance between two points, you can just turn the two points into a triangle and use the formula above to find the third side by isolating the c variable (c = distance we want to find).
So we're left with C = √A^2 + B^2