Function_Split_Plot

379 days ago by PatrickHammer

def split_plot(f,start_angle,end_angle,angle_step,plot_size): x,y=var('x,y'); li=[] baseplot=density_plot(f,(x,-plot_size,plot_size),(y,-plot_size,plot_size)) baseplot+=text("1",(+1,plot_size),rgbcolor=(1,0,0)) for m in srange(start_angle,end_angle,angle_step): def g(x): return plot_size*f(cos(m)*x,sin(m)*x) li.append(baseplot+ line([(-plot_size*cos(m),-plot_size*sin(m)),(plot_size*cos(m),plot_size*sin(m))])+ plot(g,(x,-plot_size,plot_size),color="red")) return animate(li,xmin=-plot_size,ymin=-plot_size,xmax=plot_size,ymax=plot_size) 
       
#Test: def f(x,y): return (x^2*y)/(x^4+y^2) if x^2+y^2>0 else 0 show(split_plot(f,pi,-0.1,-pi/20,10))