Ask Your Question
1

How to create a 3D plot of a parametric equation that requires 3 variables?

asked 2021-04-26 03:27:43 +0200

Buk gravatar image

updated 2021-04-26 04:03:52 +0200

I'm try to plot (one nappe of) a cone using the parametric formula (from https://en.wikipedia.org/wiki/Cone#Eq...) : parametric equation

where s , t , u range over [ 0 , θ ), [ 0 , 2 π ) , and [ 0 , h ], respectively.

I tried:

parametric_plot3d((u*tan(s)*cos(t),u*tan(s)*sin(t),u),(u,0,20),(s,0,60*(pi/180)),(t,0,2*pi) )

but it took the third range as plot_points.

Then I tried:

parametric_plot3d((u*tan(t/6)*cos(t),u*tan(t/6)*sin(t),u),(u,0,20),(t,0,2*pi) )

attempting to let t do double duty as s also. It plots, but produces: image description

Which is pretty, but no cigar.

How can I achieve my goal?

Update: I found another formulation of the equation on the web and tried:

parametric_plot3d( ( sin(x*arctan(y/x))*sin(y*arctan(y/x)), sin(x*arctan(y/x))*cos(y*arctan(y/x)), sin(x*arctan(y/x)) ), (x,-pi,pi), (y,-pi,pi) )

And got:

bad code 2

Ditto on the absence of stoggies.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
4

answered 2021-04-26 07:26:52 +0200

rburing gravatar image

updated 2021-04-27 00:12:26 +0200

slelievre gravatar image

The first parametrization is the parametrization of a solid cone.

To plot it, you can plot the boundary, which is where $s=\theta$ or $u=h$:

sage: h = 20
sage: theta = pi/3
sage: side = parametric_plot3d((lambda t, u: u*tan(theta)*cos(t),
....:                           lambda t, u: u*tan(theta)*sin(t),
....:                           lambda t, u: u), (0, 2*pi), (0, h))
sage: base = parametric_plot3d((lambda s, t: h*tan(s)*cos(t),
....:                           lambda s, t: h*tan(s)*sin(t),
....:                           lambda s, t: h), (0, theta), (0, 2*pi))
sage: side + base

Cone

edit flag offensive delete link more

Comments

I actually only need the conical surface. Thankyou for factoring that out for me.

Buk gravatar imageBuk ( 2021-04-26 08:17:19 +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

1 follower

Stats

Asked: 2021-04-26 03:27:43 +0200

Seen: 61 times

Last updated: Apr 27