x=(1-u)*x1+u*((1-v)*x2+v*x3);
y=(1-u)*y1+u*((1-v)*y2+v*y3);
%this way you went form x,y to u,v
I=x^2+y^2;
%concerning first change from x,y to u,v I should be:
%I=(u*(v*x3 - x2*(v - 1)) - x1*(u - 1))^2 + (u*(v*y3 - y2*(v - 1)) - y1*(u - 1))^2
A=(x2*y1 - x1*y2 + x1*y3 - x3*y1 - x2*y3 +...
I suppose this will work for given type of triangle, I am not going to check it. But most people need universal solution. I took me a lot of time to get to this and it works (all is written in Matlab code).
Lets say you have triangle (x1,y1) (x2,y2) (x3,y3) and you want to calculate integral...