To coin a phrase: Never Mind the Bollocks — Here’s the Hex Crystals! And what is a hex crystal? It’s what I call a shape that’s created algorithmo inside a hexagon and looks like a crystal:
A hex crystal
Here are some more hex-crystals:
I came across hex-crystals when I was looking at an interesting little geometrical question. How does sum(vd), the sum of distances to the vertices of a square, vary from different points, (x,y), inside the square? Say the square is created inside a circle of radius = 500 units and centered on (x,y) = (0,0). When the point is at (0,0), the center of the square, sum(vd) is obviously 2000, because the four vertices all fall on the perimeter of the circle at 500 units from the center and 4 * 500 = 2000:
0

sum(vd) = 2000 = sum of distances to vertices from (0,0)
When is sum(vd) at a maximum? When the point is on one or another of the vertices, which are at (+/-354,+/-354) units in relation to the center at (0,0):
sum(vd) = 2414 = sum of distances to vertices from (354,-354)
More precisely, the sum is 2414.213562373… = 1000 * (√2 + 1) units and the vertices are at (+/-353.55339…, +/-353.55339…) units, as simple geometry dictates for a square inside a circle of radius 500. Accordingly, sum(vd) varies between exactly 2000 and 2414.213562373… as the point moves inside the square:
sum(vd) = 2165 from (132,256)
sum(vd) = 2182 from (-135,271)
sum(vd) = 2069 from (177,51)
I wondered what shapes appeared as one traced the route of a point jumping, say, 1/2 towards the vertices according to tests on sum(vd). For example, if the point starts at (0,0) at time t0) and sum(vd) at time ti has to be alternately greater and less than sum(vd) at ti-1 for successive jumps, you get this shape:
jump = 1/2, test = sum(vd,ti) >,< sum(vd,ti-1)
You can use the binary number 10bin to represent the test on sum(vd) at ti-1 and ti-1, i.e. the test at jump 1 is sum(vd,ti) > sum(vd,ti-1), at step 2 is sum(vd,ti) < sum(vd,ti-1), and so on. Using the same test and a jump of 1/3, you get this shape:
jump = 1/3, test = sum(vd,ti,10bin)
Now the shape is clearly a fractal. So are some of the other shapes I found by applying the same kind of tests to a point jumping inside a pentagon:
vertex = 5, jump = 55/144 = fib(10) / fib(12), test on sum(vd) = 10bin
v = 5, j = 55/144, test = 10010bin
v = 5, j = 55/144, test = 11000bin
When test = 10010bin, you read the binary number left-to-right and check for s1><s0,s2<s1,s3<s2,s4>s3,s5<s4. Then you apply the same tests to subsequent jumps, i.e., you return to the beginning of the binary number and read it left-to-right again. Now let’s apply similar tests to hexagons and create some hex-crystals:
v = 6, j = 1/2, test = 10bin
Various hex-crystals (animated gif courtesy EZgif)
I searched an array to calculate the possible routes, so the same test yielded different results depending on dp, the depth of the search. This is because tl, the length of the test, fits more or less well into dp by dp modulo tl, that is, by whether tl is a factor of dp. For example, when the test is 110 and tl = 3, you get this with dp = 9:

v = 6, j = 1/2, test = 110, dp = 9
And you get this when dp = 10 (i.e., dp = 9+1):
v = 6, j = 1/2, test = 110bin, dp = 10dec
Here are some more hex-crystals:

test = 1100bin
test = 1110bin
test = 10010bin
test = 11010bin
test = 11100bin
test = 101000, dp = 12
test = 101100bin
test = 111100bin
test = 111100, dp = 11
test = 1110010bin
test = 1111100bin
test = 10010110bin
test = 10011110bin
test = 11000110bin
test = 11001110bin
test = 11010110bin
test = 11100110bin
test = 11101000bin
test = 11110010bin
test = 100101000bin
test = 100111110bin
test = 110011110bin
test = 110111000bin
test = 1001101010bin
test = 1001111000bin
test = 1001111010bin
test = 1010011110bin
test = 1011101110bin
test = 1101010000bin
test = 1110001110bin
test = 1110101000bin
test = 1110101010bin
test = 1111100010bin
j = 1/3, test = 1 (i.e., for all jumps sum(vd) at ti > sum(vd) at ti-1, center point
j = 2/3, test = 11100bin
j = 2/5, test = 10010bin
Finally, here are some hex-crystals based on a test of sorted distances from (x,y), i.e. how the vertices rank by distance from (x,y):

















































