Just copy & paste the code from here :
// Define the range of t values
t = 0:0.01:2*%pi;
// Define the parametric equations for a heart shape
x = 16 * (sin(t).^3);
y = 13 * cos(t) - 5 * cos(2*t) - 2 * cos(3*t) - cos(4*t);
// Create a figure and plot the heart shape
clf();
plot(x, y, 'r', 'LineWidth', 2);
xlabel('X-axis');
ylabel('Y-axis');
title('Heart Shape');
// Set aspect ratio to be equal so that the heart shape is not distorted
axis('equal');
Image will look like this |
0 Comments