我有一个双循环,看起来是这样的:
for i in xrange(len(myVVV)):
for j in xrange(len(myVVV[i])):
if myVVV[i][j]!= -1:
s=i,j
print(myVVV[i][j])
print(s)
给出了:
^{pr2}$
我试着通过检查s代表网格上数字点位置的点来创建“三角形”,基本上我会连接点1,3,4,根据那里的位置形成一个三角形。有什么办法吗?在
我能读的东西?我正在创建一个刻面文件,这就是为什么我需要用顶点等三角形
Tags:
这是我的代码,它很管用,对于以后的情况如果人们需要它请放心,希望它能有所帮助
你查过matplotlib了吗?这个答案here是用来画多边形的。
你可以试着反转坐标,从而证明两个点是对角的。你也可以用这个来检查对角线位置是否有一个点。然后,把它们组合起来,检查那个位置是否有一个点-如果有,你就有一个三角形。 例如
只是一个建议,可能会阻止一些想法到正确的道路:)我只是想到了这个,所以如果你找到一个洞,就放轻松点:p
相关问题 更多 >
编程相关推荐