Mathematica Help (Graphing Heart Equation)

In summary, the conversation is about graphing a mathematical function in 3D using Mathematica. The person asks for the command to enter and shares what they have tried, including attaching a picture of their result. They eventually figure out the correct way to graph the function and share the code and image.
  • #1
Chinnu
24
0
ok, I have tried and failed.

How does one graph the following on mathematica in 3D:

[itex]\left( x^{2} + \frac{9}{4} x^{2} + z^{2} -1\right)^{3} - x^{2}z^{3} - \frac{9}{80}y^{2}z^{3} =0[/itex] [itex]with -3 \leq x,y,z\leq3 [/itex]

If someone could give me the command (what to enter), that would help.

Heres what I tried:

Plot3D[f[x,y,z],{x,-3,3},{y,-3,3},PlotRange[itex]\rightarrow[/itex]{-3,3}],

where I pre defined f as the function above (this I'm fairly certain was done correctly)
 
Last edited:
Physics news on Phys.org
  • #2
ok, I tried the following and got the picture attached:



ContourPlot3D[itex]\left[\left( x^{2}+\frac{9}{4} y^{2}+z^{2} -1 \right)^{3} - x^{2} z^{3} - \frac{9}{80} y^{2} z^{3},\left\{x, -3, 3 \right\}, \left\{ y, -3, 3 \right\}, \left\{ z, -3, 3 \right\}\right][/itex]

It is, of course, not what I am trying to achieve...
 

Attachments

  • graph.png
    graph.png
    27.7 KB · Views: 501
  • #3
I got it finally...

heres what I did

f[x_,y_,z_] [itex] = \left( x^{2}+\frac{9}{4} y^{2}+z^{2} -1 \right)^{3} - x^{2} z^{3} - \frac{9}{80} y^{2} z^{3} [/itex]

ContourPlot3D[f[x, y, z], {x, -3, 3}, {y, -3, 3}, {z, -3, 3}, Boxed -> False, Contours -> {0}, ContourStyle -> Red, Axes -> False,
Mesh -> None]

and I got the following graph (I haven't yet figured out how to resize it (by scaling within mathematica itself, not just re-sizing the image), since it is kind of small now
 

Attachments

  • graph.png
    graph.png
    2.1 KB · Views: 474

Related to Mathematica Help (Graphing Heart Equation)

1. What is the "Heart Equation" in Mathematica?

The "Heart Equation" is a mathematical equation that represents the shape of a heart. It is a polar equation that can be graphed using the PolarPlot function in Mathematica.

2. How do I graph the Heart Equation in Mathematica?

To graph the Heart Equation in Mathematica, you can use the PolarPlot function and input the equation as the first argument. For example: PolarPlot[3*(1 + Sin[t]), {t, 0, 2Pi}] will graph the basic heart shape.

3. Can I customize the graph of the Heart Equation in Mathematica?

Yes, you can customize the graph of the Heart Equation in Mathematica by changing the coefficients in the equation or adding additional terms. You can also change the range of the graph and add labels and styling options using the PolarPlot function.

4. Are there any other functions in Mathematica that can graph the Heart Equation?

Yes, there are other functions in Mathematica that can graph the Heart Equation, such as ParametricPlot and ContourPlot. These functions may offer more customization options, but they require the conversion of the polar equation into a parametric or Cartesian form.

5. Can I use the Heart Equation in Mathematica to create animations?

Yes, you can use the Heart Equation in Mathematica to create animations by using the Manipulate function and changing the parameters in the equation. You can also use the Animate function to create a smooth animation of the graph.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
276
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Precalculus Mathematics Homework Help
Replies
23
Views
623
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • General Math
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top