C (gcc), (削除) 169 (削除ここまで) 166 bytes
Thanks to ceilingcat for the suggestions! I also changed the newlines in the header to spaces as they seem to work fine as separators (at least in Irfanview) and fixed a bug that got revealed when the array was put on the stack.
Generates an image in PBM format, as it's probably the simplest way to make a bitmap! For some reason, all the online PBM viewers that I tried don't seem to like the output file, but Irfanview and GIMP are fine with it.
f(r,w){char s[(w=r*2+11)*w+1];float x=0;for(memset(s,48,w*w),s[w*w]=0;x<7;x+=1e-5)s[(int)(round(sin(x)*r+r+5)+round(cos(x)*r+r+5)*w)]=49;printf("P1 %d %d %s",w,w,s);}
- 4.8k
- 9
- 11