Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica Help (Graphing Heart Equation)

  1. Apr 15, 2012 #1
    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:


    where I pre defined f as the function above (this I'm fairly certain was done correctly)
    Last edited: Apr 16, 2012
  2. jcsd
  3. Apr 16, 2012 #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.....

    Attached Files:

  4. Apr 16, 2012 #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

    Attached Files:

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook