Last active
April 12, 2026 12:22
-
-
Save RYSF13/9340c61d7a25da4eb937aac060963321 to your computer and use it in GitHub Desktop.
rendering a blackhole in 4 lines
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
| // blackhole.c - rendering blackhole in 4 lines | |
| float R,o,b,e,r,t/*Y.Stanford*/;main(_){for(o=-10;++o<10;puts("") | |
| )for(R=-31;++R<30;)b=R*.98-o*.2,e=o*.98+R*.2,t=hypot(R,2*o)-7,r=( | |
| .65+.35*cos(atan2(2*o,R)-.2))/exp(t*t),t=b*b<225?(.65+b*.023)/exp | |
| (e*e/.3):0,putchar(" .,-~+*#"[_=((r=t>r?t:r)>1?7:r*7)]);}//rysf13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment