如何从c#中的窗口形式获取顶点的位置?

2024-04-26 10:14:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经开始使用无线传感器网络模拟器,我想模拟我自己的拓扑,它需要制作连接顶点的环(边界外壳)。 我试图得到窗口窗体(图形)上表示的每个顶点的位置,这些顶点是其他顶点的邻居,并将它们相互连接,但我想在最近的顶点之间建立连接,(彼此之间具有最小半径的顶点)wireless sensor network simulator ( node (vertex) deployment)

我的问题是,如何得到每个顶点的位置? 下面的代码4bell是我试图计算reduise的方法 int r1=(int)Math.Sqrt(Math.Pow(firstNode.x-((WirelessSensor)firstNode.sensorneights[count]).x,2)+Math.Pow(firstNode.y-((WirelessSensor)firstNode.sensorneights[count]).y,2)); int r2=(int)Math.Sqrt(Math.Pow(firstNode.x-((WirelessSensor)firstNode.sensorneights[count+1]).x,2)+Math.Pow(firstNode.y-((WirelessSensor)firstNode.sensorneights[count+1]).y,2))


Tags: 网络countmath传感器sqrt模拟器外壳int