Ask Your Question
0

how do i plot a parabola in the x=2 plane?

asked 2020-02-04 16:19:29 -0600

updated 2020-02-04 16:42:00 -0600

vdelecroix gravatar image

I apologize, for I am very new to sage. Here is what I input; the error was that y was not defined.

f(x)=x^2
P=implicit_plot3d(lambda x,y,z:x-2,(-2,2),(-2,2),(-2,8))
plot(f)+plot3d(P)
edit retag flag offensive close merge delete

Comments

You can use var('y') to define y as a variable, and similarly for z.

John Palmieri gravatar imageJohn Palmieri ( 2020-02-04 18:28:50 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2020-02-04 19:41:51 -0600

dazedANDconfused gravatar image

To get your plot using the parametric_plot3d command that vdelecroix suggested, you could try:

u = var('u')
parametric_plot3d([2,u,u^2],(u,-2,2))

The result, running in a SageCellServer is shown: image description

edit flag offensive delete link more

Comments

Note that the command var('u') defines u: you should be able to use var('u') rather than u = var('u'). Unfortunately many of the examples in the Sage documentation needlessly use the longer version.

John Palmieri gravatar imageJohn Palmieri ( 2020-02-05 00:47:36 -0600 )edit

Good point. It's a habit I struggle to break.

dazedANDconfused gravatar imagedazedANDconfused ( 2020-02-05 13:11:18 -0600 )edit
1

answered 2020-02-04 16:46:05 -0600

vdelecroix gravatar image

First of all, P is in itself a graphics object. Writing plot3d(P) does not make much sense.

Secondly, f is a one-variable function so that plot(f) is a 2 dimensional picture (that works). But then the addition plot(f)+plot3d(P) is trying to concatenate a 2-dimensional and a 3-dimensional picture that looks weird.

Now, to draw a curve in 3d you can for example use parametric_plot3d.

edit flag offensive delete link more

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: 2020-02-04 16:19:29 -0600

Seen: 608 times

Last updated: Feb 04