Question by lostlyre
Can anyone tell me the formula for finding a missing set of coordinates of a triangle, while knowing two coordinates and three sides?
An ActionScript Snippet Example by birdy1976
// given var xA = -2; var yA = -4; var xB = +5; var yB = -1; var a = Math.sqrt(36+16); // exact value var b = Math.sqrt(49+1); // exact value // calculation var xAB = xB-xA; var yAB = yB-yA; var c = Math.sqrt(xAB*xAB+yAB*yAB); var alpha = Math.acos((b*b+c*c-a*a)/(2*b*c)); var epsilon = Math.atan2(yAB, xAB); var xCA = -b*Math.cos(alpha+epsilon); var yCA = -b*Math.sin(alpha+epsilon); var xC = xA-xCA; var yC = yA-YCA; trace("("+xC+"|"+yC+")"); // -> C(xC|yC) = C(-1|3)