Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sage.plot.circle import Circle
- @interact
- def myplot(f=0,xmin = -1, xwidth = 1):
- xman = xmin + xwidth
- p1 = plot(f,(xmin,xman),thickness = 1.5)
- roots = solve(f,x)
- show('Корни уравнения:', roots)
- for i in range(len(roots)):
- roots[i] = roots[i].rhs()
- circles = [j for j in range(len(roots))]
- for i in range(len(circles)):
- circles[i] = circle((roots[i],0),0.2)
- p1+=circles[i]
- p1 += plot(diff(f,x),(xmin,xman),thickness=0.6,color = 'green')
- diffRoots = solve(diff(f),x)
- show('Точки экстремума: ', diffRoots)
- for i in range(len(diffRoots)):
- diffRoots[i] = diffRoots[i].rhs()
- diffCircles = [j for j in range(len(diffRoots))]
- for i in range(len(diffCircles)):
- diffCircles[i] = circle(((diffRoots[i]),0), 0.2,color = 'green')
- p1+=diffCircles[i]
- show(p1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement