查找悉尼地图之间的距离 [英] Find the distance between Sydney Map

查看:131
本文介绍了查找悉尼地图之间的距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,让我说出我的问题.悉尼地图的地图网格从17到271.每个网格都有x和y轴. x轴从A到L,y轴从1到16.

现在,我将客户端地图网格另存为169-L15.这意味着,客户在第169网格中,他的坐标(x,y)在第169网格中.同样,我将其他客户端地图网格参考保存为150-A10,187-B14,依此类推.

现在我的问题是如何找到169-L15到150-A10或187-B14等的距离.


请为此提供帮助.

谢谢

First let me give my problem back ground. Sydney map has Map grid from 17 to 271. And each grid has x and y axis. For x-axis A to L and for y-axis 1 to 16.

Now i save the client map grid as 169-L15. This mean, client is in 169th grid and his coordinate (x,y) in 169th grid is (L,15). Similarly i save other client map grid reference as 150-A10,187-B14, and so on.

Now my question is how do i find the distance from 169-L15 to 150-A10 or 187-B14 etc.


Please need a help on this.

Thanks

推荐答案

为每个字母分配一个数字(A = 1,B = 2,...,L = 12).这将为您提供X和Y值,可用于计算距离(结果不是特定单位,而是网格").将2个网格之间的X减去以得到x距离,然后将2个网格之间的Y减去以得到y距离.使用路径定理(a ^ 2 + b ^ 2 = c ^ 2)计算实际距离(c = sqrt(a ^ 2 + b ^ 2)).如果您知道每个网格边的距离(假设每个网格是一个正方形),则可以将该值乘以网格数以获得实际距离.
Assign a number to each letter (A = 1, B = 2, ..., L = 12). That gives you an X and Y value you can use to calculate a distance (the result being in no specific units, but in "grids"). Subtract the X''s between 2 grids to get the x-distance and subtract the Y''s between 2 grids to get the y-distance. use the pathagorean theorum (a^2 + b^2 = c^2) to calculate the actual distance (c = sqrt(a^2 + b^2)). If you know the distance of each grid edge (assuming each grid is a square), then you can multiply that value by the number of grids to get the actual distance.


您好,
谢谢回复.不幸的是,网格不是正方形的.它的矩形.大部分网格是Width = 2cm和Height = 1.7cm的矩形.但某些网格编号(如251,272等)的宽度= 2cm和高度= 1.7 cm.它们具有不同的宽度和高度.

谢谢
Hi,
Thanks for the reply. Unfortunately grids are not square. Its rectangle. Most of the grid are rectangle of Width=2cm and Height=1.7cm. but some grid number like 251,272 etc are not of width=2cm and height=1.7 cm. They have different width and height.

Thanks


修改过的pathagorean定理:
Modified pathagorean theorum:
c = sqrt(a^2 + b^2)


获取a和b的值:


Get the value of a and b:

a = (x1 - x2) * d1
b = (y1 - y2) * d2


展开修改后的pathagorean定理:


Expand the modified pathagorean theorum:

c = sqrt(((x1 - x2) * d1)^2 + ((y1 - y2) * d2)^2)


插入d1和d2的值. d1是现实生活中每个单元的宽度(不在纸上). d2是现实生活中每个单元的高度(不在纸上).结果c将是现实生活中2个单元之间的距离.


Plug in the values for d1 and d2. d1 is the width of each cell in real life (not on paper). d2 is the height of each cell in real life (not on paper). The result, c, will be the distance between 2 cells in real life.


这篇关于查找悉尼地图之间的距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆