How Do You Graph 3D Functions in Mathematica 8?

In summary, the conversation discusses how to graph functions in 3space using Mathematica. The person seeking help is taking a course in multivariable calculus and is struggling with visualizing graphs in 3space. They have tried asking multiple teachers and tutors but have not received a satisfactory answer. They have purchased Mathematica and are looking for guidance on how to use it to graph functions in 3space. The conversation then delves into the specifics of using ContourPlot3D and RegionPlot3D to graph functions in 3space. The person requesting help expresses their hope that these techniques will work for them and mentions the value of Mathematica's documentation as a reference.
  • #1
Levi Tate
122
0
(note for editor; this is not a homework problem, this is bred out of my desire to visualize 3space)

Hello fellows,

I am hoping that somebody can help me. I've asked multiple teachers and tutors, but nobody can solve my seemingly very easy problem.

I am taking a course in multivariable calculus. I never planned on going into math and physics, it just happened naturally. Anyways, we are getting into 3space, and I am having trouble seeing what graphs in 3space actually look like, when viewed in a plane. That's why I bought Mathematica, but I cannot figure out how to graph a function in 3space. If somebody could help me with what to do I could greatly appreciate it. The functions do not need to be complex, I just want to see what is going on in three dimensions visually.

Here are a few examples from my text, if you could show me the way to graph one of these in three dimensions I'm sure I can use that syntax to graph other functions.

Thank you in advance if you can help me out here.


I want to get something with three variables..

Okay..

6x + 2y + 3z = 6

Then maybe a sphere as well

x^2 + y^2 + z^2 = 4
 
Physics news on Phys.org
  • #2
Hi, just started 3 dimensional calulus, too. The three coordinates refer to x y z axis. x is repositioned in 3 dimensions. y takes the place of x, and then z becomes the position y had. To graph a coordinate in tree dimensions, the first number is to move forward, towards yourself, from the origin. That is the x axis. The next number moves to the right, which is the new y axis. And the third number moves up, which is the new z axis. This positioning assumes al numbers (1,2,3) are positive.
If the z coordinate is 0, that means it has no height. That means it would lie entirely on the "floor", which is caled the xy plane. A PLANE looks like a flat sheet of paper. No height, no volume. The major diference between dimensions in my opinion is that x=6 on an x y graph will be a sraight line. But X=6 on an x,y,z graph is no longer just a line. It is now a PLANE, and looks like a sheet of paper. When x=6 on the 2D graph, there are infinite values of y in two directions, north and south. But on a 3D graph, there are infinite values for y AS WELL AS Z. That means the values are infinite again in both north and south directions (which represents z axis), as well as east and west (which represents y axis).


The coordinates (1,1,1) are a single point, just as they are in 2D. If a sphere equals 25, that means the radius is 5. (5^2)=25. You have to square the radius in a spere equation because the line created by the spere is not linear. The square curves the line. So the radius would measure 5 units from the center along each axis.
 
  • #3
Sure, I hope this pushes this thread to the top so somebody proficient can answer my question.

I'm asking about how to graph 3space on mathematica.
 
  • #4
I'm sure everyone will jump to answer your question now.
 
  • #5
Sure, what you said was good and all (I think) and I did not mean to disparage you, but I just want to know how to graph these things on Mathematica 8
 
  • #6
I saw the word mathematica (as in, Principia). Also, you would not be visualizing anything. Visualize means to see a mental picture in your head, not on a computer screen.
 
  • #7
Okay, I don't want to turn this into a puerile discussion of the semantics of what I wrote. It is my hope that somebody capable can provide me with the syntax I need to graph in 3space on Mathematica. Thank you in advance if you could help me with this, it will help me very much.
 
  • #8
That is a good question. I had never actually used to visualize 3D surfaces until now. Nice idea. Here are some example bits of script:

ContourPlot3D[6 x + 2 y + 3 z == 6, {x, -3, 3}, {y, -3, 3}, {z, -3, 3}]
ContourPlot3D[x^2 + y^2 + z^2 - 4==0 , {x, -3, 3}, {y, -3, 3}, {z, -3, 3}]

I choose to use ContourPlot3D because in general you will not be able to describe a surface using z = f(x,y). IF you can write z=f(x,y), then you can use Plot3D but ContourPlot3D would work also. I think it is clear that ContourPlot3D will basically plot the surface that satisfies the equation. Make sure you use double equals. The below bit is just a more general form.

ContourPlot3D[f(x,y,z)==0, {x, xmin, xmax}, {y, ymin, ymax}, {z, zmin, zmax}]

Also it you want to make the surface look "nice" try

ContourPlot3D[x^2 + y^2 + z^2 - 4==0 , {x, -3, 3}, {y, -3, 3}, {z, -3, 3}, Mesh->None]

Check out the documentation for some more options but this should cover what you want.

PS: It just occurs to me that you might find it useful to plot regions in 3 space. Check out RegionPlot3D in the Mathematica documentation. It is just like ContourPlot3D but allows inequalities or systems of inequalities so you can define regions.
 
Last edited:
  • #9
Thanks a lot mate

I won't have time to try these until tonight, as I have physics and then math all day today.

I hope they work, right now I paid 125$ and the only thing I can do is add 2+2.

I could have did that with my abacus.

I really hope these work, understanding mathematica is like taking a course kind of, I don't really have a lot of time to learn the syntax, so hopefully when i plug these in with the equations in my notes they'll show up.

Thanks again.
 
  • #10
Let me know if you have trouble, but they worked for me.

In general, I find Mathematica's greatest strength for a beginner is the documentation. The documentation is mostly just a bunch of examples. Check it out. I didn't know about ContourPlot3D until I checked the documentation. The way I found it was I knew about ContourPlot and that it was useful for 2D plots were you have a function like f(x,y)=0. I figured that if Mathematica had something for 3D plots if would be mentioned. At the bottom of each page in the documentation is a list of related functions. That is how I found ContourPlot3D.

Good luck.
 
  • #11
Thank you very much!

This really helps me see what's going on in 3space when I put in the functions.

Do you know how I can calibrate the bounds so the surfaces look the way I want them to, or is it arbitrary because they're extending past those points in the cube?

Sorry if that sounds dumb, I'm just getting a feel for this stuff.
 
  • #12
Well if you want to change the domain over which the plot is made, you just need to change the limits

So this will show a cube that is 6x6x6 centered at (0,0,0)

ContourPlot3D[f(x,y,z)==0,{x,-3,3},{y,-3,3},{z,-3,3}]


This will show a larger region that is a 8x8x8 cube centered at (0,0,0)

ContourPlot3D[f(x,y,z)==0,{x,-4,4},{y,-4,4},{z,-4,4}]

The limits do not have to be the same


ContourPlot3D[f(x,y,z)==0,{x,0,4},{y,-1,3},{z,-10,10}]

You have to pick limits that make sense for the surface you want to see. It might take a few educated guesses.
 
  • #13
If I remember MV calculus properly, I think we sometimes graphed 3D surfaces using Plot3D or PlotEquation3D. They take input using these syntax forms:

Plot3D[function of two variables, {var1, min, max}, {var 2, min, max}]

PlotEquation3D[left side of eqn == Right side of eqn, {x, min, max}, {y, min, max}, {z, min, max}]

You might also be interested in SphericalPlot or ParametricPlot3D.

Furthermore, if you want to get a template for the syntax of a command, you type the command name and then ctrl + shift + k. If you want information about a command, you type a question mark and then the command name and input the cell, i.e., ?Plot3D. In the little info box that pops up, you can click the >> to go to the Documentation Center, which will give you even more info.
 

FAQ: How Do You Graph 3D Functions in Mathematica 8?

What is a 3space graph on Mathematica 8?

A 3space graph is a type of graph on Mathematica 8 that displays data in three dimensions. It allows for the visualization of complex data sets and can help to identify patterns and relationships in the data.

How do I create a 3space graph on Mathematica 8?

To create a 3space graph on Mathematica 8, you can use the "ListPointPlot3D" or "ListPlot3D" functions. These functions allow you to input the data points and customize the appearance of the graph, such as the color and shape of the data points.

Can I add labels and annotations to my 3space graph?

Yes, you can add labels and annotations to your 3space graph on Mathematica 8. You can use the "PlotLabel" function to add a title to your graph and the "PlotLegends" function to add a legend. You can also use the "Text" function to add text annotations to specific data points on the graph.

What types of data are best displayed on a 3space graph?

3space graphs are best suited for displaying data that has three variables or dimensions. This can include data sets with three numerical variables, or data sets with two numerical variables and one categorical variable. 3space graphs are especially useful for displaying data that has a non-linear relationship.

Can I rotate and manipulate my 3space graph on Mathematica 8?

Yes, you can rotate and manipulate your 3space graph on Mathematica 8. You can use the "ViewPoint" and "ViewVertical" options to change the viewing angle of the graph. You can also use the "Manipulate" function to interactively rotate and zoom in on the graph.

Similar threads

Replies
4
Views
596
Replies
9
Views
672
Replies
8
Views
2K
Replies
3
Views
937
Replies
8
Views
2K
Replies
5
Views
2K
Replies
5
Views
646
Replies
2
Views
2K
Back
Top