Mathematica Mathematica Help (Graphing Heart Equation)

  • Thread starter Thread starter Chinnu
  • Start date Start date
  • Tags Tags
    Heart Mathematica
AI Thread Summary
To graph the heart equation in Mathematica, the correct command is to define the function f as f[x_, y_, z_] = (x^2 + (9/4) y^2 + z^2 - 1)^3 - x^2 z^3 - (9/80) y^2 z^3. Then, use ContourPlot3D with the syntax ContourPlot3D[f[x, y, z], {x, -3, 3}, {y, -3, 3}, {z, -3, 3}, Boxed -> False, Contours -> {0}, ContourStyle -> Red, Axes -> False, Mesh -> None]. The user successfully created the graph but is seeking advice on resizing it within Mathematica. The discussion highlights the importance of using the correct plotting functions and parameters for achieving the desired visual output.
Chinnu
Messages
22
Reaction score
0
ok, I have tried and failed.

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

\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 with -3 \leq x,y,z\leq3

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\rightarrow{-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
ok, I tried the following and got the picture attached:



ContourPlot3D\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]

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

Attachments

  • graph.png
    graph.png
    27.7 KB · Views: 550
I got it finally...

heres what I did

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

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: 525

Similar threads

Replies
4
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
4
Views
3K
Replies
1
Views
2K
Back
Top