First time here? Check out the FAQ!

Ask Your Question
0

How to combine the @interact command with complex plot?

asked 11 years ago

updated 10 years ago

FrédéricC gravatar image

How to combine the @interact command with complex plot? Hi, I'm trying to create a code to combine the @interact command with complex plot. I have created the complex plot using

sage: f(z) = z^5 + z - 1 + 1/z
sage: complex_plot(f, (-3, 3), (-3, 3))

but I wish to change the z^5 term to z^x where I can create a slider for the value of x using the @interact command. Does anyone know how I should start with this? I'm currently a high student working for a project but I don't know much about sage. If you know anything and can explain in simple terms it will be greatly appreciated. THANK YOU

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 11 years ago

vdelecroix gravatar image

Hi,

You should have a look at the documentation of interact. You can access the documentation with

sage: interact?

For your specific example, you can do

var('z')
@interact
def my_interact(a=(1,5,1)):
    f(z) = z^a + z - 1 + 1/z
    complex_plot(f, (-3, 3), (-3, 3)).show()
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 370 times

Last updated: May 25 '13