# coding:utf-8 import numpy as np import matplotlib.pyplot as plt def dis(x, y): #计算距离 return np.sum(np.power(y - x, 2)) def dataN(length,k):#生成数据 z=range(k) c=[5]*length a1= [np.sin(i*2*np.pi/k) for i in range(k)] a2= [np.cos(i*2*np.pi/k) for i in r