开发者

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)));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜