well if you know valid triangle sides lengths (l1,l2,l3) and their angles (a,b,c) ...
- then it is quite simple with vector math ...
// compute directions
a1=0;
a2=180-b;
a3=a2+180-c;
a3=-b-c;
a3=-a;
// convert them from [deg] to [rad]
a1*=Math.pi/180.0;
a2*=Math.pi/180.0;
a3*=Math.pi/180.0;
// compute points
A=(x0,y0); // your start point is known
B=A+l1*dir(a0)=(x0+l1*Math.cos(a0),y0+l1*Math.sin(a0));
B=A+l1*dir( 0)=(x0+l1 ,y0 ); // a0 is always zero
C=A-l3*dir(a3)=(x0-l3*Math.cos(a3),y0-l3*Math.sin(a3)); // C from A point
C=B+l2*dir(a2)=(x0+l1+l2*Math.cos(a2),y0+l2*Math.sin(a2)); // C from B point
[notes]
- as you can see there are more alternatives for some variables choose one you like
- do not forget to check if l1+l2>l3 and l1+l3>l2 and l2+l3>l1
- if not then your lengths are not valid triangle sides
- also a+b+c = 180
- if not then your angle computation is wrong
- if you want to over-check the triangle then compute C from A and from B point
- if they are not the same (their distance > some accuracy constant like 0.001)
- then it is not a valid triangle