夢追い人

"It takes a dreamer to make a dream come true."―Vincent Willem van Gogh

AOJ No.0010 挑戦開始(笑)

結構むりやり毎日このブログ書こうとしてますw

というわけで今日は外接円の問題。

0010

え〜と…外接円の中心の求め方を忘れました(;´Д`)

 /*
Write a program which prints the central coordinate (px, py) and the radius r of a circumscribed circle of a triangle which is constructed by three points (x1, y1)(x2, y2)(x3, y3) on the plane surface.
 */

void solve(double a, double b, double c, double d, double e, double f) {
	int px,py,r;
	// 外接円の半径
	r = sqrt(pow(max(px,a)-min(px,a), 2)+pow(max(py,b)-min(py,b), 2));
	printf("%4.3f %4.3f %4.3f",px,py,r);
}

int main() {
	int n; cin >> n;
	double x1, y1, x2, y2, x3, y3;
	for (int i=0; i<n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		solve(x1,y1,x2,y2,x3,y3);
	}
	return 0;
}

というわけで今日は無理せずココまで。

ぼちぼちノートとかあさってやっていこうと思います。


p.s.心電図とかのスケジュールの関係で今度の朝10時からのSRM出られることに!!!やったね☆