implicit diff

2542 days ago by chrisphan

foliumpts = [[3*t/(1 + t^3), 3*t^2/(1 + t^3)] for t in srange(-0.5, 75, 0.01)] foliumpts.extend([[3*t/(1 + t^3), 3*t^2/(1 + t^3)] for t in srange(-25, -2, 0.01)]) folium = line(foliumpts) html('Plot of the Folium of Descartes: $x^3 + y^3 = 3xy$') show(folium, figsize=[5,5]) graphs = [] tanglinepts = [k for k in range(0, 300, 10)] tanglinepts.extend([k for k in range(300, 500, 50)]) tanglinepts.extend([k for k in range(500, 1000, 100)]) tanglinepts.extend([k for k in range(1000, 2500, 300)]) tanglinepts.extend([k for k in range(8000, 9400, 300)]) tanglinepts.extend([k for k in range(9400, 9800, 100)]) tanglinepts.extend([k for k in range(9800, 9849, 10)]) for i in tanglinepts: pt = foliumpts[i] deriv = (3*(pt[0])^2 - 3*(pt[1]))/(3*pt[0] - 3*(pt[1])^2) graphs.append(plot(deriv*(x - pt[0]) + pt[1], x, -1.75, 1.75, rgbcolor=(1, 0, 0)) + folium + point(pt, rgbcolor=(0, 1, 0))) html('Tangent lines for various points on the folium') a = animate(graphs, ymin=-1.75, ymax=1.75, figsize=[5, 5]) a.show() 
       
Plot of the Folium of Descartes: x^3 + y^3 = 3xy
Tangent lines for various points on the folium
                                
                            
Plot of the Folium of Descartes: x^3 + y^3 = 3xy
Tangent lines for various points on the folium
                                
astroidpts = [[(cos(t))^3, (sin(t))^3] for t in srange(0, 2*pi, 0.01)] astroid = line(astroidpts) html('Plot of the Astroid: $x^{2/3} + y^{2/3} = 1$') show(astroid, figsize=[5,5]) graphs1 = [] tanglinepts1 = [k for k in srange(0, len(astroidpts), 10)] for i in tanglinepts1: pt = astroidpts[i] if pt[0] != 0: deriv = (-1)*sgn(pt[0]*pt[1])*abs(pt[1])^(1/3)/abs(pt[0])^(1/3) graphs1.append(plot(deriv*(x - pt[0]) + pt[1], x, -1.75, 1.75, rgbcolor=(1, 0, 0)) + astroid + point(pt, rgbcolor=(0, 1, 0))) html('Tangent lines for various points on the astroid') a = animate(graphs1, xmin=-1.1, xmax=1.1, ymin=-1.1, ymax=1.1, figsize=[5, 5]) a.show() 
       
Plot of the Astroid: x^{2/3} + y^{2/3} = 1
Tangent lines for various points on the astroid
                                
                            
Plot of the Astroid: x^{2/3} + y^{2/3} = 1
Tangent lines for various points on the astroid
                                
fig8pts = [[0,0]] fig8pts.extend([[sqrt(4*cos(2*t)*(sec(t))^4)*cos(t), sqrt(4*cos(2*t)*(sec(t))^4)*sin(t)] for t in srange(-1*pi/4+0.01, pi/4-0.01, 0.01)]) fig8pts.extend([[0, 0]]) fig8pts.extend([[sqrt(4*cos(2*t)*(sec(t))^4)*cos(t), sqrt(4*cos(2*t)*(sec(t))^4)*sin(t)] for t in srange(3*pi/4+0.01, 5*pi/4-0.01, 0.01)]) fig8pts.extend([[0,0]]) fig8 = line(fig8pts) horiztangs = [[sqrt(2), -1], [-1*sqrt(2), -1], [sqrt(2), 1], [-1*sqrt(2), 1]] outputgraphic = fig8 for pt in horiztangs: outputgraphic = outputgraphic + point(pt, rgbcolor=(1, 0, 0)) html('Plot of the figure eight: $x^4 = 4(x^2 - y^2)$') show(fig8, figsize=[5,5]) html('Points on the figure eight with horizontal tangents') show(outputgraphic, figsize=[5,5]) 
       
Plot of the figure eight: x^4 = 4(x^2 - y^2)
Points on the figure eight with horizontal tangents

                                
                            
Plot of the figure eight: x^4 = 4(x^2 - y^2)
Points on the figure eight with horizontal tangents