Created
December 27, 2013 19:29
-
-
Save AnimeshShaw/8151498 to your computer and use it in GitHub Desktop.
Got the equation from http://mathworld.wolfram.com/HeartSurface.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment