22
2
Take a unit circle centered on the origin. In any two neighboring quadrants, mirror the curve of the circle across the lines connecting the circle's x and y intercepts.
With the resulting shape, you can tile the plane:
I made this image with the awesome 2D physics sandbox Algodoo!
Write a program that outputs an image similar to this one in some common lossless image file format. You may save the image as a file with the name of your choice or you may simply display it. No input should be taken.
Rules:
The entire image must be tessellated with the modified-circle tiles using any two visually distinct RGB colors: one for the vertically pointing tiles, one for the horizontally pointing tiles.
The radius of the circle tiles should be at least 32 pixels. (The radius in the image above is about 110 pixels.)
The image should be at least 4 tiles wide and 4 tiles tall. This, combined with the rule above, means that images can have a minimum size of 256×256 pixels. (The image above is 4 tiles by 4 tiles.)
The tessellation may be translated by any amount. For example, the top left corner of the image does not need to be the vertex where tiles meet. (The tessellation should not be rotated, however.)
You may use external graphics libraries that have commands for drawing circles and outputting images and the like.
The curves really should approximate circles, as can done with the midpoint circle algorithm, which most graphics libraries will do for you.
Anti-aliasing around the edges of the tiles is allowed but not required.
The shortest submission in bytes wins.
1Won't the edges be slightly distorted thanks to 3d perspective? – orlp – 2015-05-09T04:04:47.267
6With a height of
0.1
and an offset of0.001
the disk is tilted by $\phi=\arctan(0.01) = 0.57°$, looking from the top the disks appear squeezed by a factor of $\cos(\phi) = 0.99995$, thats far less than a pixel. – DenDenDo – 2015-05-09T07:20:43.233@DenDenDo is pov-ray not able to put a camera at infinity? – Random832 – 2015-05-10T04:03:16.530
@Random832 it can, with
camera{orthographic location -9z}
. But since the scene is basically 2D it makes no difference, you can even render it with a viewingangle 170
without any fisheye distortion in the result. – DenDenDo – 2015-05-10T09:21:44.630