♡
- t = 0 → 2𝜋
- x = 16 sin³(t)
- y = 13 cos(t) - 5 cos(2 t) - 2 cos(3 t) - cos(4 t)
LC_ALL=ISO-8859-1 awk 'BEGIN { \
pi=atan2(0, -1); \
for (t=0; t<(pi*2); t+=pi/180) { \
print "P6"; print "256 256"; print "255"; \
if (t==0) { \
for (i=0;i<256*256;i++) \
printf "%c%c%c",128,0,128; \
continue \
} \
px=16*(sin(t)^3); \
px*=7.5; \
py=13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t); \
py*=7.5; \
for (y=127;y>=-128;y--) \
for (x=-128;x<128;x++) \
if (sqrt((px-x)^2 + (py-y)^2) < 3) \
printf "%c%c%c",255,0,0; \
else \
printf "%c%c%c",255,255,255; \
}}' | convert -transparent white -compose Copy -set delay 1 -coalesce -layers RemoveDups - heart.gif