To start I used a Nexus 7 and did not test anything. I had a lot of syntax and other things wrong. Next I was scaling wrong way for projection to view. I tried inverse formula and thought that was it because it worked how I thought it should. I also tried it other ways. Eventually I got that correct. Next I did draw order.
I tried only by vertices average, knew that was not math sound. I tried by intersections of shapes and connections, fail. I did make only intersect parts of lines and that worked well. I tried to do average of all distances for shapes. In that I omitted square root in integrals and that was off. I tried to make an equation with sqaure root in integrals, not feasible with polygons. StinomXE is like my latest attempt, it was intentionally made faulty to an extent.
As I know it, a best way to draw order is to only consider parts that intersect in view. This is because no matter how much I fine tune averages or like averages, it is one point's distance from view point that I am basically comparing and if one is actually behind but smaller and closer than that point then it may falsely be made to draw before. As of writing of this thing I still need to implement this.