I am having trapezoid with three coordinates known. So I need to create the 4th coordinate with length, width and angles I am having. You can assume this problem with $△ADC$ from trapezoid. The model comes as differently expected . The Law of cosines gives the angle but it should be applied to local coordinates of the model. Right side I am showing with arrow pointed as wrong object which i am getting. Even if I rotate the object or flip it, the coordinates should not get wrong. They should get adjusted with the object's coordinates, width, angle and length.
newWidth2 is $AB$, newLength is $AD$. Point $C$ need to be created from $A$, $D$ with $∠A$ or $∠D$ also. Math.Pow is "to the power of" and 2 is it's square.(for who can't understand this notation).
//Initially I will have Coordinates for C but later I should remove them and create from the model width and heights.
//distance formula
newWidth2 = Math.Sqrt(Math.Pow(CoordX3 - CoordX5, 2) + Math.Pow(CoordY3 - CoordY5, 2));
//from the formula -> b2 = a2 + c2 - 2acCos(B)
diagangle = Math.Acos((Math.Pow(newWidth2, 2) - Math.Pow(newdiagonal, 2) - Math.Pow(newLength, 2)) / (-2 * (newdiagonal) * (newLength)));
//I am getting this C coordinates as wrong.
//for getting C (third coordinates)
xcoord3 = CoordX5 + (newWidth2 * Math.Cos(diagangle));
ycoord3 = CoordY5 + (newWidth2 * Math.Sin(diagangle));
