| |
r = 46.5 w = 15 gap = 3 turn = 2 polygon = 8 for k,v in enumerate(range(int((0.5+turn)*polygon))): r1 = r+k*(gap+w)/polygon r2 = r+(k+1)*(gap+w)/polygon theta = np.arctan((r2/r1)/np.sin(2*np.pi/polygon)-1/np.tan(2*np.pi/polygon)) r_ref = r1/np.cos(theta) theta = theta+k*2*np.pi/polygon str.extend( [ "x:=",r_ref*np.cos(theta), "y:=",r_ref*np.sin(theta), ]) x,y坐标计算方法 |