4425: Circle Intersection

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:Special Judge 上传者:
提交:0 通过:0

题目描述

Calculate the length of the intersection of two circles in 3D space.



输入格式

There are no more than 10000 test cases. For each test case two lines of integer numbers are given, describing the two circles in 3D space respectively.

A circle in 3D space is described by 7 integer numbers – its radius  and two 3D coordinates. The first coordinate (x1, y1, z1) is its center, while the second (x2, y2, z2) represents the normal vector of the plane where the circle lies.

It is guaranteed that the two circles given are not parallel or coplanar.

1 ≤ r ≤ 10000, all the other input integers are in range [−10000,10000].

输出格式

Each case one line, the lengh of the intersection. The error between the result and the answer should not exceed 10−5.

输入样例 复制

1 0 0 0 0 0 1
1 1 1 0 1 1 0
1 0 0 0 0 0 1
2 1 0 0 1 1 1

输出样例 复制

0
1.414214