Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question
1

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

asked 3 years ago

Buk gravatar image

updated 3 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
4

answered 3 years ago

rburing gravatar image

updated 3 years ago

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=θ 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

Preview: (hide)
link

Comments

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

Buk gravatar imageBuk ( 3 years ago )

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: 3 years ago

Seen: 445 times

Last updated: Apr 27 '21