Red de conocimiento informático - Material del sitio web - Cómo dibujar un triángulo equilátero usando la tortuga pitón

Cómo dibujar un triángulo equilátero usando la tortuga pitón

# -*- codificación: utf-8 -*-

importar numpy como np

importar matplotlib.pyplot como plt

fig, ax = plt.subplots()

x=np.linspace(-10, 10, 1000)

y=np.linspace(-10, 10, 1000)

X, Y = np.meshgrid(x, y)

Z=X**2 (Y-1.5*X**(2/3))**2-1

ax.contour(-1*X, Y, Z,)

ax.contour(X, Y, Z,)

ax.text( -0.3, -6.5, r'$\dag$', color='r', alfa=0.8, tamaño de fuente=25)

ax.text(-7.5, -8.5, r'$\ell $', tamaño de fuente=20, color='r')

ax.text(-5.5, -8.5, r'$x^2 y^2=1$', tamaño de fuente=20, color= 'g')

ax.text(0.8, -8.5, r'$|x|$', tamaño de fuente=20, color='b')

ax.text( 3.5, -8.5, r'$\lim_{n \to \infty}(1 \frac{1}{n})^n$',

fontsize=20, color='c')

ax.set_title(r'$x^2 (y -\sqrt[3]{x^2})^2 = 1$')

ax.set_xlabel(r '$i$', tamaño de fuente=20)

ax.set_ylabel(r'$u$', tamaño de fuente=20, rotación=0)