Plot 3D Intersection of x+y+z=1 & x^2+y^2+z^2=1 - Mathematica

In summary, to plot two separate functions on the same coordinates using the Plot3D command in Mathematica, you can use the Show function with the appropriate parameters. For example, if you want to plot the intersection of x+y+z=1 and x^{2}+y^{2}+z^{2}=1, you can use the strings "string" and "string2" and then use the Show function with DisplayFunction -> $DisplayFunction. This method works for both 2D and 3D plots in Mathematica.
  • #1
amcavoy
665
0
If I am using the Plot3D command in Mathematica, how can I plot two separate functions on the same coordinates? Specifically, I am trying to get a picture of the intersection of [itex]x+y+z=1$[/itex] with [itex]x^{2}+y^{2}+z^{2}=1[/itex].
 
Physics news on Phys.org
  • #2
I suck at mathematica and probably won't help too much, but when I plot many functions or equations I do,
string = Plot[xxxxxxxxxxxxxxxxxxx, DisplayFunction -> Identity]
string2 = Plot[xxxxxxxxxxxxxxxxxxx, DisplayFunction -> Identity]
...
...
...
Show[{string, string2,...}, DisplayFunction -> $DisplayFunction]

It works for both plots2d and 3d in my mathematica. I dunno.
 
  • #3
Plot3D[{1-x-y},{(1-x^2-y^2)^0.5},{x,-10,10},{y,-10,10}]

Should work, I think...

(Although I use Mathematica rarely - Matlab always :-p )
 
  • #4
Those worked, thanks a lot guys :smile:.
 

Related to Plot 3D Intersection of x+y+z=1 & x^2+y^2+z^2=1 - Mathematica

1. How do I plot the 3D intersection of x+y+z=1 and x^2+y^2+z^2=1 using Mathematica?

To plot the 3D intersection of these two surfaces, you can use the ContourPlot3D function in Mathematica. This function allows you to specify the equations for each surface and then plots their intersection. You can also adjust the ContourStyle to make the intersection more visible.

2. Can I change the color of the 3D intersection plot?

Yes, you can change the color of the 3D intersection plot by using the ContourStyle option in the ContourPlot3D function. You can specify a color or a color function to use for the plot.

3. How do I add labels to the axes in the 3D intersection plot?

To add labels to the axes in the 3D intersection plot, you can use the AxesLabel option in the ContourPlot3D function. This allows you to specify the labels for the x, y, and z axes. You can also adjust the font and size of the labels using the LabelStyle option.

4. Is it possible to add a legend to the 3D intersection plot?

Yes, you can add a legend to the 3D intersection plot by using the LegendLabel option in the ContourPlot3D function. You can specify the label for the legend and also adjust the font and size of the legend using the LegendLabelStyle option.

5. Can I rotate the 3D intersection plot to view it from different angles?

Yes, you can rotate the 3D intersection plot by using the ViewPoint option in the ContourPlot3D function. This allows you to specify the coordinates of the point from which the plot should be viewed. You can also use the ViewVertical option to adjust the orientation of the plot.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
302
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
179
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
784
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
168
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
451
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Back
Top