import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display,Math
print('Squircle: https://mathworld.wolfram.com/Squircle.html')
display(Math('x^4+y^4=a^4'))
# x**4 + y**4 = 1
# x**4 = 1 - y**4
# x = (1 - y**4)**(1/4)
# y = (1 - x**4)**(1/4)
x = np.linspace(-1,1,2001)
y = (1 - x**4)**(1/4)
# x**2 = 4
# x = +2, -2
plt.plot(x,y,'k',linewidth=3) # positive y
plt.plot(x,-y,'k',linewidth=3) # negative y
plt.axis('square')
plt.axis('off')
plt.show()