math, coordinates
now i making some problem with JAVA, but don't remember how get lenght between to coordinate-system.
Ex. point A (3,7) Point B (7,59)
I want 开发者_如何转开发to know how count distance between point a and b. very thanks for your answers. :-)
A = (xa, ya), B = (xb, yb)
Assuming you want euclidean distance ("natural" distance):
distance = sqrt((xa - xb)^2 + (ya - yb)^2).
pythagoras gave that answer
sqrt(((A.X - B.X) * (A.X - B.X)) + (((A.Y - B.Y) * (A.Y - B.Y)));
精彩评论