测量两点之间的距离 Topic is solved

这是wxWidgets论坛的中文版本。在这里,您可以用您的母语汉语讨论上面任一子论坛所涉及的所有关于wxWidgets的话题。欢迎大家参与到对有价值的帖子的中英互译工作中来!
Post Reply
yangweiwei
Earned a small fee
Earned a small fee
Posts: 11
Joined: Fri Mar 12, 2010 2:54 am

测量两点之间的距离

Post by yangweiwei » Tue Mar 23, 2010 5:39 am

我想测量两点之间的距离,怎么办好啊?

BlueDream
Earned a small fee
Earned a small fee
Posts: 13
Joined: Tue May 19, 2009 4:07 am

Re: 测量两点之间的距离

Post by BlueDream » Sat Mar 27, 2010 11:36 pm

yangweiwei wrote:我想测量两点之间的距离,怎么办好啊?
得知道两点的坐标:(x1,y1) (x2,y2)
d = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))

yangweiwei
Earned a small fee
Earned a small fee
Posts: 11
Joined: Fri Mar 12, 2010 2:54 am

Re: 测量两点之间的距离

Post by yangweiwei » Mon Mar 29, 2010 8:25 am

BlueDream wrote:
yangweiwei wrote:我想测量两点之间的距离,怎么办好啊?
得知道两点的坐标:(x1,y1) (x2,y2)
d = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
那单位是什么呢?

kingkamg
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Tue Apr 08, 2008 1:45 pm

Post by kingkamg » Thu May 13, 2010 1:40 am

.......................你两点坐标啥单位就啥了

BaddyBoy
In need of some credit
In need of some credit
Posts: 3
Joined: Mon May 17, 2010 4:47 am
Contact:

Post by BaddyBoy » Tue Jun 22, 2010 1:57 am

ScreenToClient得到客户区的相对坐标。
单位一般是默认的。。

Post Reply