import numpy as np
import matplotlib.pyplot as plt
%matplotlib notebook
A = np.array([[0,1],[1,1]])
A
A = np.array([[1e-20,1],[1,1]])
A
L = np.array([[1,0],[1e20,1]])
L
R = np.array([[1e-20,1],[0,1-1e20]])
R
L@R
L@R - A
x = np.linspace(-19.57,0,500)
f = 1/7*(-x)**(3/2)* ( (3/2)**(np.sqrt(-x))-np.floor((3/2)**(np.sqrt(-x))))
plt.figure()
plt.plot(x,f);
plt.figure()
plt.fill(x,f,x,-f,linewidth=3,color='green');
fig = plt.figure(1)
ax = fig.add_subplot(111)
ax.fill(f,x,-f,x,linewidth=3,color='green');
fig = plt.figure(1)
ax = fig.add_subplot(111)
ax.fill(f,x,-f,x,linewidth=3,color='green');
ax.fill([-.5,.5,.5,-.5,-.5],[-19.5,-19.5,-22,-22,-19.5],color='brown',linewidth='4');
def n_stern(n):
x = [(0.5+ j % 2)*np.sin(np.pi*2*j/n) for j in range(2*n+1)]
y = [(0.5+ j % 2)*np.cos(np.pi*2*j/n) for j in range(2*n+1)]
return x ,y
#' Hintergrund
fig = plt.figure(1)
ax = fig.add_subplot(111)
ax.fill(f,x,-f,x,linewidth=3,color='green');
ax.fill([-.5,.5,.5,-.5,-.5],[-19.5,-19.5,-22,-22,-19.5],color='brown',linewidth='4');
fig.set_facecolor('darkblue')
ax.axis('off');
from mpl_toolkits.mplot3d import Axes3D
from numpy.random import rand
fig = plt.figure(100)
ax = fig.add_subplot(111,projection='3d')
theta = np.linspace(-np.pi,np.pi, 50)
X = f.reshape((-1,1)) * np.sin(theta).reshape(1,-1)
Y = f.reshape((-1,1)) * np.cos(theta).reshape(1,-1)
Z = x.reshape((-1,1)) * np.ones_like(theta).reshape(1,-1)
sc = ax.plot_surface(X, Y, Z, color='green');
nFlocken = 10
xs = 20*rand(nFlocken,1)-10
ys = 20*rand(nFlocken,1)-10
zs = -20*rand(nFlocken,1)+2
sc = ax.scatter3D(xs,ys,zs,'b*')
ax.axis('off');