Interesting shape

Habr, hello. This article does not pretend to be too serious, I just want to share a new form that I discovered. This is a circle, the color of the points of which is equal to the sum of the squares of the coordinates of the given point. In other words pixel_color = (pixel_x ^ 2 + pixel_y ^ 2) .toString (16).







This figure itself is very interesting, it is something like a clear interference fractal or even a model of the universe that describes the micro and macrocosm. While it's easy to get it, I haven't found anything like it anywhere. Perhaps I'm a pioneer. If so, I would like to call it a tetrascope. In the given example, I generate a tetrascope with a radius of 1024px, the maximum that I was able to generate on my machine is an object with a radius of 4096px, a picture of which weighs ~ 150 megabytes.



This model is an absolute, by which I mean that its physical-mathematical model exists by itself, long before its discovery and independently of a person, as a self-sufficient form of being.



PS: I recommend watching the picture on a computer at 100% scale- so it is more clear what she is. In the comments, I suggest experimenting with the code, suggesting your description and the meaning of the picture or its name, and in general, somehow supplement this post, perhaps with some information.



$(document).ready(function(){
	var R=1024; var D=2*R;
	var rgb = function(c){
		if(c.length<=6)	return c+("0".repeat(6-c.length));
		else return c.substring(0, 3)+c.substring(c.length-3);
	}
	$('body').append('<canvas id="C" width="'+(R*2)+'" height="'+(R*2)+'">');
	var canvas = document.getElementById('C');
	var ctx = canvas.getContext('2d');
	ctx.fillStyle="#ffffff00";
	ctx.fillRect(0, 0, 256, 256);
	for(var x = 0;x<D;x++) {
		for(var y = 0;y<D;y++) {					
			var X1 = R-x;
			var Y1 = R-y;
			var X2 = R+x;
			var Y2 = R+y;
			if (( x*x+y*y )   <=   R*R    ) {
				ctx.fillStyle="#"+(   rgb( (x*x+y*y).toString(16))   );
				ctx.fillRect(X1, Y1, 1, 1);
				ctx.fillRect(X1, Y2, 1, 1);
				ctx.fillRect(X2, Y1, 1, 1);
				ctx.fillRect(X2, Y2, 1, 1);
	}	}	}
});



All Articles