Plotting a plane in Mathematica

In summary, the person is looking for a way to plot the plane y=2 in 3d. They state that they have tried parametric crap with t's and it just gave them a stupid line. They finally found out what they needed to do though to get an actual plane to show up though.
  • #1
Pengwuino
Gold Member
5,124
20
Hello ladies and gentlemen,

Does anyone know how to plot the plane y=2 in 3d? I'm looken for a curve of intersection with a surface and I don't seem to know how to plot the y=2 plane :)
 
Physics news on Phys.org
  • #2
What do you mean by plotting? You can understand that it contains all points in 3d space where the co-ordinate of y is 2. For example (0,2,0), (2,2,0) and (0,2,2). You must know that three non-collinear points define a plane. So it is the plane that consists of the following points
 
  • #3
Well I needed to know how to enter that into Mathematica. I was trying parametric crap with t's and it just gave me a stupid line. I finally found out what i had to do though to get an actual plane to show up though.. thanks anyways.
 
  • #4
hey having the same problem what u did to get the plane?
 
  • #5
Use the Plot3D command:

Plot3D[y = 2, {x, 0, 10}, {y, -2, 2}]

Nota bene: If you fail to express the equation as an equality, it automatically treats the first argument as equal to an unspecified z variable. So the function
Plot3D[y - 2, {x, 0, 10}, {y, -2, 2}] would *not* plot a y-plane, since it actually would end up plotting z = y - 2 (although the zero level set of that function would be your plane)
 
Last edited:
  • #6
wil3 said:
Use the Plot3D command: Plot3D[y = 2, {x, 0, 10}, {y, -2, 2}]

I believe that is plotting z=2 and not y=2. You can verify that with this
Plot3D[y = 2, {x,0,10}, {y,-2,2}, AxesLabel->{x,y,z}]
to label the axes so you can see if your plane is at 2 on the z axis or the y axis.

To plot in the y=2 plane I believe this might do what you want:
ParametricPlot3D[{x,2,z}, {x,-2,2}, {z,-2,2}, AxesLabel->{x,y,z}]

There is a nice tutorial I found using Google that you can use to learn this stuff.
http://www.math.uconn.edu/~hurley/math220/Mathematica_docs/Planes.pdf
 
  • #7
I see what you mean... doesn't plotting y = 2 look the same as plotting z = 2, just with different axes labeling? And that's strange that even though y = 2 is explicitly stated, Mathematica interprets it as z = 2
 
  • #8
wil3 said:
And that's strange that even though y = 2 is explicitly stated, Mathematica interprets it as z = 2

Mathematica is very likely not the language you think it is or doing what you think it is doing.

When you put y=2 in there it created a definition that in the future if you ever used y it should be immediately replaced with 2, at least until you changed it, AND THEN the "value" of y=2 was also 2, so the "y" was gone by the time Plot3D got its hands on what you wrote. So what Plot3D "saw" was Plot3D[2, etc,etc,etc]. Now since Plot3D is expecting some sort of function giving the value of z for the various values of x and y it then plotted the plane z==2 and that was what you saw when you added axis labels.

Learning the strange way that Mathematica evaluates expressions is a serious undertaking. Even when you think you are finally getting the hang of it you are probably only getting close to ready to move up to the next level in the game.
 
  • #9
okay man. my bad
 

1. How do I plot a plane in Mathematica?

To plot a plane in Mathematica, you can use the function Plot3D. This function takes in three arguments: the equation of the plane, the range of values for the x and y axes, and the options for the plot. For example, to plot the plane 2x + 3y - z = 5 over the range x: -5 to 5 and y: -5 to 5, you would use the code Plot3D[2x + 3y - z == 5, {x, -5, 5}, {y, -5, 5}].

2. Can I add labels and titles to my plane plot?

Yes, you can add labels and titles to your plane plot using the PlotLabel and AxesLabel options in the Plot3D function. For example, to add a title to your plot, you would use the code PlotLabel -> "Plane Plot". To add labels for the x, y, and z axes, you would use the code AxesLabel -> {"x", "y", "z"}.

3. How can I change the color or style of my plane plot?

To change the color or style of your plane plot, you can use the ColorFunction, PlotStyle, and MeshStyle options in the Plot3D function. These options allow you to specify the color and style of the plot, as well as the color and style of the mesh lines on the plot. For example, to change the color of the plot to red, you would use the code ColorFunction -> Red. To change the style of the plot to a dotted line, you would use the code PlotStyle -> Dotted.

4. How can I add other objects, such as points or vectors, to my plane plot?

You can add other objects, such as points or vectors, to your plane plot by using the Graphics3D function. This function allows you to combine multiple graphics objects together, including your plane plot and any additional objects you want to add. For example, to add a point at the coordinates (1,1,1), you would use the code Graphics3D[{Point[{1, 1, 1}]}, PlotRange -> All].

5. Can I rotate and manipulate my plane plot in Mathematica?

Yes, you can rotate and manipulate your plane plot in Mathematica using the Manipulate function. This function allows you to interactively change the values of variables in your plot, such as the range of values for the x and y axes, and see the changes reflected in the plot. For example, to create a slider that allows you to change the range of values for the x axis, you would use the code Manipulate[Plot3D[2x + 3y - z == 5, {x, -a, a}, {y, -5, 5}], {a, 1, 10}].

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
245
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
888
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
748
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Back
Top