#assignment of Pattern Recognition def EDistance(d1xd1yd2xd2y): result = pow(d1x - d2x 2) result += pow(d1y - d2y 2) result = pow(result0.5) return result
listX = [] listY = [] TempList = [] minimum = [] mension = 2 num = int(input(“Input the number of spots “)) Theta = float(input(“Input Theta “)) for i in range(num): listX.append(int(input(“Input {}th Xcoordinate “.format(i+1)))) listY.append(int(input(“Input {}th Ycoordinate “.format(i+1)))) Distance = [[0 for i in range(10)]for i in range(num)] group = [[]for i in range(10)]
for i in range(num): TempList.append(EDistance(listX[0]listY[0]listX[i]listY[i])) Distance[0][i] = EDistance(listX[0]listY[0]listX[i]listY[i])
评论
共有 条评论