Graphing cylinders in Mathematica

In summary, the conversation discusses the creation of two cylinders, one semi-transparent and the other perpendicular to it, using Mathematica. The goal is to find the complete intersection of the two cylinders, with one participant struggling with finding the parametrizations and the other offering a solution to use Show[] to display both cylinders on the same graph.
  • #1
Reflected
13
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
  • #2
Do you have difficulties finding the parametrizations of the cylinder and the intersection or using mathematica?:smile:
 
  • #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];
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.
 
  • #4
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.
 

1. How do I create a cylinder graph in Mathematica?

To create a cylinder graph in Mathematica, you can use the built-in function Cylinder[]. This function takes in three arguments: the center point of the base, the radius of the base, and the height of the cylinder. You can also specify additional options such as color and opacity for customization.

2. Can I plot multiple cylinders in one graph?

Yes, you can plot multiple cylinders in one graph by using the Show[] function. This function takes in a list of graphics objects, including cylinders, and combines them into one plot. You can also use the Graphics3D[] function to create a 3D scene with multiple cylinders.

3. How do I change the orientation or position of a cylinder in my graph?

To change the orientation or position of a cylinder in your graph, you can use the RotationTransform[] or TranslationTransform[] functions. These functions allow you to specify the desired rotation or translation in 3D space. You can then apply these transformations to your cylinder using the GeometricTransformation[] function.

4. Can I add labels or annotations to my cylinder graph?

Yes, you can add labels or annotations to your cylinder graph using the Text[] function. This function allows you to specify the text, position, and style of your label. You can also use the Inset[] function to add images or other graphics elements as annotations.

5. How do I export my cylinder graph as an image or vector file?

You can export your cylinder graph as an image or vector file by using the Export[] function. This function allows you to specify the desired file format, resolution, and other options for your export. You can also use the Graphics3D[] function to create a 3D scene and then export it as a 3D graphics file.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
684
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
613
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
Back
Top