Illusztráció a Brouwer-féle fixponttételhez
import numpy as np
var("x,y,t")
M=matrix(RR,[[0,1,0],[-1,0,0],[0,0,1]])
@interact
def gyures3d(a=slider(0, 1, 0.1, default=0),b=slider(0, 1, 0.1, default=0)):
f(x,y)=(1-a)*x+a*y
g(x,y)=b*(0.5+0.5*cos(2*x+6*y))+(1-b)*y
racs=Graphics()
for s in np.arange(0,1.05,0.05):
racs += parametric_plot3d( vector([f(s,t), g(s,t), 0.3*t])*M, (t, 0, 1), color="red", thickness=2)
racs += parametric_plot3d( vector([f(t,s), g(t,s), 0.3*s])*M, (t, 0, 1), thickness=2)
show(racs)
import numpy as np
var("x,y,t")
@interact
def gyures(a=slider(0, 1, 0.1, default=0),b=slider(0, 1, 0.1, default=0)):
f(x,y)=(1-a)*x+a*y
g(x,y)=b*(0.5+0.5*cos(2*x+6*y))+(1-b)*y
racs=Graphics()
for s in np.arange(0,1.05,0.05):
racs += parametric_plot( (f(s,t), g(s,t)), (t, 0, 1), color=hue(1,1-0.5*s,1), thickness=2)
racs += parametric_plot( (f(t,s), g(t,s)), (t, 0, 1), color=hue(0.7,1-0.5*s,1), thickness=2)
show(racs)
show(plot_vector_field((f(x,y)-x,g(x,y)-y), (x,0,1), (y,0,1)))
show(streamline_plot((f(x,y)-x, g(x,y)-y), (x,0,1), (y,0,1)))