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

 

结果:

 

posted @ 2018-12-21 20:49  时间带着假象流淌  阅读(1164)  评论(0编辑  收藏  举报