The expression below is for a text layer (display all 3 coordinates in 1 single text) :
A = thisComp.layer("A").transform.position.value;
B = thisComp.layer("B").transform.position.value;
C = thisComp.layer("C").transform.position.value;
M = thisComp.layer("Point").transform.position.value;
AB = sub(B,A); if (AB.length<3) AB.push(0);
BC = sub(C,B); if (BC.length<3) BC.push(0);
CA = sub(A,C); if (CA.length<3) CA.push(0);
AM = sub(M,A); if (AM.length<3) AM.push(0);
u = cross(AB, CA);
U = dot(u,u);
c = dot(u, cross(AM, AB))/U*100;
b = dot(u, cross(AM, CA))/U*100;
a = 100-(b+c);
letters= ["a", "b", "c"];
values = [a,b,c];
for (k=0; k<3; k++) letters[k] += " : " + (values[k]<10 ? " " : "") + values[k].toFixed(1) + "%";
letters.join("\n");
It’s not optimal as it does unnecessary calculations, but trying to optimize would make it less compact.
Xavier
