The midpoints are easily calculated. See below
// Calculate midpoints of the three sides double xL = (x0+x1)/2.0; double yL = (y0+y1)/2.0; double xR = (x1+x2)/2.0; double yR = (y1+y2)/2.0; double xB = (x0+x2)/2.0; double yB = (y0+y2)/2.0;
There are three solid blue triangles in the figure. Could each of them be drawn as three smaller triangles?