MATHEMATICAL ART | Astonishing Codes

Recently, I found a contest which required people to write 3 Tweetable (meaning 140 characters or less) function bodies for the red, green, and blue values of a 1024x1024 image. The results are astonishing…

Let me show you some of the masterpieces:

Work from Martin Büttner. Codes as follows:
unsigned char RD(int i,int j){ #define r(n)(rand()%n) static char c[1024][1024];return!c[i][j]?c[i][j]=!r(999)?r(256):RD((i+r(2))%1024,(j+r(2))%1024):c[i][j]; } unsigned char GR(int i,int j){ static char c[1024][1024];return!c[i][j]?c[i][j]=!r(999)?r(256):GR((i+r(2))%1024,(j+r(2))%1024):c[i][j]; } unsigned char BL(int i,int j){ static char c[1024][1024];return!c[i][j]?c[i][j]=!r(999)?r(256):BL((i+r(2))%1024,(j+r(2))%1024):c[i][j]; }

Another work from Martin Büttner. Codes as follows:
unsigned char RD(int i,int j){ float x=0,y=0;int k;for(k=0;k++<256;){float a=xx-yy+(i-768.0)/512;y=2xy+(j-512.0)/512;x=a;if(xx+yy>4)break;}return log(k)47; } unsigned char GR(int i,int j){ float x=0,y=0;int k;for(k=0;k++<256;){float a=xx-yy+(i-768.0)/512;y=2xy+(j-512.0)/512;x=a;if(xx+yy>4)break;}return log(k)47; } unsigned char BL(int i,int j){ float x=0,y=0;int k;for(k=0;k++<256;){float a=xx-yy+(i-768.0)/512;y=2xy+(j-512.0)/512;x=a;if(xx+yy>4)break;}return 128-log(k)*23; }

Work from Manuel Kasten. Codes as follows:
unsigned char RD(int i,int j){ double a=0,b=0,c,d,n=0; while((c=aa)+(d=bb)<4&&n++<880) {b=2ab+j8e-9-.645411;a=c-d+i8e-9+.356888;} return 255pow((n-80)/800,3.); } unsigned char GR(int i,int j){ double a=0,b=0,c,d,n=0; while((c=aa)+(d=bb)<4&&n++<880) {b=2ab+j8e-9-.645411;a=c-d+i8e-9+.356888;} return 255pow((n-80)/800,.7); } unsigned char BL(int i,int j){ double a=0,b=0,c,d,n=0; while((c=aa)+(d=bb)<4&&n++<880) {b=2ab+j8e-9-.645411;a=c-d+i8e-9+.356888;} return 255*pow((n-80)/800,.5); }

Work from Eric Tressler. Codes are as follows:
unsigned char RD(int i,int j){ #define A float a=0,b,k,r,x #define B int e,o #define C(x) x>255?255:x #define R return #define D DIM R BL(i,j)(D-i)/D; } unsigned char GR(int i,int j){ #define E DM1 #define F static float #define G for( #define H r=a1.6/D+2.4;x=1.0001b/D R BL(i,j)(D-j/2)/D; }

Has this inspired you? Is there any kind of creative contest you would like Anker to hold in the future? Please leave me a comment, I’m looking forward to hearing your thoughts!

6 Likes

Can see this reaction being caused for some :smiley:

The following link might help explain further;

All for future creative contest’s, hopefully not this brain taxing though :laughing:

4 Likes

Whoa that is trippy but totally awesome.

@AnkerOfficial I think this kind of contest would be cool, or something like paint with words, Poetry in Motion or something unique like that

1 Like

That is my expressions right now! :sweat_smile: I thought excel art was fascinating!

We could make a contest AnkerMathArt, by using Anker name number order in the alphabet (for example A is letter #1, N is letter #14, K is letter#11…). Let’s user to decide what graph they could do with those number. Then we could pick the best graph.

Having been a teacher, I can’t help but think that this would be a great lesson/project for coding class that incorporates art and math. However, having been an English teacher, I have no idea how any of this works, but it’s pretty cool!

1 Like

1 Like

Hahaha, is it difficult for everyone to make Math Art?

It is not that difficult. there are website drawing graph based on math functions. This one is an example: https://www.desmos.com/

1 Like

This is the only maths I need

£29.99 - Anker Discount 50% = £14.98 :smiley:

4 Likes

Better

£29.99 - Anker Discount 90% = £3

3 Likes


Uploading…

1 Like

Then how would they make profit for future innovations :grin:

woah, whatt?! that is awesome…

Discount, not regular price.

Amazing stuff. Thanks for sharing!

Me too…:joy: it’s completely beyond me…:joy:

1 Like

@Oggyboy @nigelhealy, maybe the Christmas discount!:smile:

1 Like

Haha maybe :pray::santa: