Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Graphing cylinders in Mathematica

  1. Feb 26, 2008 #1
    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];

    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!
  2. jcsd
  3. Feb 26, 2008 #2
    Do you have difficulties finding the parametrizations of the cylinder and the intersection or using mathematica?:smile:
  4. Feb 26, 2008 #3
    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];
    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.
  5. Feb 27, 2008 #4


    User Avatar
    Science Advisor
    Homework Helper

    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.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Graphing cylinders Mathematica Date
Putting Excel graph into LaTeX Feb 10, 2018
Matlab Graphing in Matlab Oct 9, 2017
Matlab Matlab Power Fit on Graph-Codes Apr 23, 2017
Matlab Displaying the Fit Equation On graph. Apr 2, 2017
Plot lines in 3d as cylinders May 29, 2009