Graphing cylinders in Mathematica

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 11K views
Reflected
Messages
13
Reaction score
0
Below is some code that creates a semi-transparent cylinder.
firstcylinder =
ParametricPlot3D[{Cos[t], u, Sin[t]}, {t, 0, 2 Pi}, {u, -2, 2} ,
PlotStyle -> {Red, Opacity -> .3}, Mesh -> None];
Show[firstcylinder]

Draw a second cylinder that is perpendicular to the given cylinder.
Draw a three-dimensional curve that shows that complete intersection of the two cylinders.

Need help!
 
Physics news on Phys.org
Do you have difficulties finding the parametrizations of the cylinder and the intersection or using mathematica?:smile:
 
It's kind of both, I have gotten somewhere though.
secondcylinder =
ParametricPlot3D[{(u*Sin[Pi] + Cos[Pi]*Cos[t]),
Sin[t], (u*Cos[Pi] - Sin[Pi]*Cos[t])}, {t, 0, 2 Pi}, {u, -2, 2} ,
PlotStyle -> {Blue, Opacity -> .3}, Mesh -> None];
Show[secondcylinder]
I don't know how to graph both cylinders on the same graph, but that graph itself looks perpendicular to the first cylinder. If that's true, then I'm not sure about the second part about how to find the curve that shows the complete intersection of the two cylinders.
 
If you put them together by Show[firstcylinder, secondcylinder], you will see that they intersect. The problem is asking you to "highlight" the surface points that are common to both.