Ask Your Question
1

plot function not working (x^2+y^2=1)

asked 2021-08-21 18:54:42 +0200

ivaralink gravatar image

Im trying to plot x^2+y^2=1 like so: plot([x^2+y^2==1],(x,-5,5),(y,-5,5))

Can anyone what i am doing wrong?

I get "TypeError: float() argument must be a string or a number, not 'tuple'"

edit retag flag offensive close merge delete

Comments

Welcome to Ask Sage! Thank you for your question!

slelievre gravatar imageslelievre ( 2021-08-21 18:59:24 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-08-21 18:59:01 +0200

slelievre gravatar image

updated 2021-08-21 19:00:12 +0200

The relation x^2 + y^2 = 1 is not an expression of y as a function of x.

To plot the graph of such a relation, Sage has a dedicated method.

It is called implicit_plot.

Try this:

sage: x, y = SR.var('x, y')
sage: implicit_plot(x^2 + y^2 == 1, (x, -5, 5), (y, -5, 5))

For the various types of 2D plots available in Sage, see:

edit flag offensive delete link more

Comments

Thanks :),

ivaralink gravatar imageivaralink ( 2021-08-21 19:08:55 +0200 )edit

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: 2021-08-21 18:53:45 +0200

Seen: 67 times

Last updated: Aug 21 '21