The idea is expressed by my picture.
For example: I will divide square
1 into triangle
1 and 2. So the coordinate of triangle 1 is (0, 1); (0, 0); (1, 0;)
and the triangle 2 is (0, 1); (1, 0); (1, 1)
. Similarly to the rest of the squares.
Which algorithm i have to use in order to calculate the rest coordinates of all triangles.