Thursday, July 2, 2015

3D Heart Surface in MATLAB


Matlab is pretty neat, I downloaded a trial version of Matlab to try it out. I came across on Mathworld something called Heart Equation and this 3D Heart Surface which looked pretty neat and cool and hence I tried it out in MATLAB.

Here's the code :-

clc
clear all
[x, y, z] = meshgrid(-10:0.05:10,-10:0.05:10,-10:0.05:10);
r = power((power(x,2) + ((9/4).*power(y,2)) + power(z,2) - 1),3) - (power(x,2).*power(z,3)) - ((9/80).*(power(y,2).*power(z,3)));
p = patch(isosurface(x,y,z,r,0));
set(p,'facecolor','red','EdgeColor','none');
daspect([1,1,1]);
view(3);
axis off;
camlight('right')
lighting phong;

Related Posts:

  • LaTeX Math Symbols LaTeX is very important when you're writing your paper or creating a scientific presentation and you need to describe some math equations. LaTeX … Read More
  • 3D Heart Surface in MATLAB Matlab is pretty neat, I downloaded a trial version of Matlab to try it out. I came across on Mathworld something called Heart Equation and thi… Read More
  • Math Expression Parser in Java Hello Everyone, Today I am sharing a simple math expression parser that I made. This parser can parse and evaluate math expressions. About the P… Read More

Follow Me!

Followers

Visitor Map