public class CalcAnglesDemo {
public static void main(String[] args) {
int x1 = 100, y1 = 150;
int x2 = 255, y2 = 66;
int x3 = 360,y3 =220;
double a = Math.sqrt(Math.pow(x2 - x3, 2) + Math.pow(y2 - y3, 2));
double b = Math.sqrt(Math.pow(x1 - x3, 2) + Math.pow(y1 - y3, 2));
double c = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
double radianA = Math.acos((a*a-b*b-c*c) / (-2 * b * c));
double radianB = Math.acos((b*b-a*a-c*c) / (-2 * a * c));
double radianC = Math.acos((c*c-b*b-a*a) / (-2 * b * c));
double degreeA = Math.toDegrees(radianA);
double degreeB = Math.toDegrees(radianB);
double degreeC = Math.toDegrees(radianC);
String str = String.format("A角:%.2f B角:%.2f C角:%.2f", degreeA,degreeB,degreeC);
System.out.println(str);
}
}