三角形外心
题目:https://ac.nowcoder.com/acm/contest/4692/A # include <iostream> # include <cstdio> using namespace std ; int main ( ) { double x1 , y1 , x2 , y2 , x3 , y3 , a1 , a2 , b1 , b2 , c1 , c2 ; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 ; a1 = 2 * ( x2 - x1 ) ; b1 = 2 * ( y2 - y1 ) ; c1 = x2 * x2 + y2 * y2 - x1 * x1 - y1 * y1 ; a2 = 2 * ( x3 - x2 ) ; b2 = 2 * ( y3 - y2 ) ; c2 = x3 * x3 + y3 * y3 - x2 * x2 - y2 * y2 ; printf ( "%.3f " , ( c1 * b2 - c2 * b1 ) / ( a1 * b2 - a2 * b1 ) ) ; printf ( "%.3f" , ( a1 * c2 - a2 * c1 ) / ( a1 * b2 - a2 * b1 ) ) ; return 0 ; } 来源: CSDN 作者: 小白白同学& 链接: https://blog