I have an array of Triangle objects that are equilateral triangles and have for x and y coordinates the center of the triangle :
The distance between this point and a, b or c is t_r.
The distance between this point and A, B or C is t_R.
The side of a triangle is t_size
I want to create a function that place each triangle on a grid following this order :
So this function gets the index of the triangle in the array and updates its x and y position. Do you have any idea how I could proceed ? You should note that when the triangles are upside down, their center point is still as if they were straight but I just draw them inverted. For example, the translation from the first triangle to the second isn't up and right but only right.
I really don't know how I could do this. I tried to find a pattern in each "level" (color) of triangles but I didn't find any, neither in the side where the next triangle will be that change for every triangle...


t_R/2(one third of the height)