用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()

 

结果:

 

转载于:https://www.cnblogs.com/ConnorShip/p/10158842.html

你可能感兴趣的:(python)