用python表白了!!!

用python 画一颗心,代码:

 

 import numpy as np
 import matplotlib.pyplot as plt

 x = np.linspace(-8 , 8, 1024)
 y1 = 0.618*np.abs(x) - 0.8* np.sqrt(64-x**2)
 y2 = 0.618*np.abs(x) + 0.8* np.sqrt(64-x**2)
 plt.plot(x, y1, color = 'r')
 plt.plot(x, y2, color = 'r')
 plt.show()

结果:

猜你喜欢

转载自www.cnblogs.com/ConnorShip/p/10158842.html