Under construction

Still being built. Things may change

Circumference of a Circle

Interview

Time limit1sMemory limit128 MB

Summary
For each line of three non-collinear points, compute the perimeter of the circle passing through them, rounded to two decimals.
Level

Easy3 of 10

Topics
Geometry, Math, Implementation, Brute force
Solved
No attempts yet

Problem

You are given three points that do not lie on a single straight line. Write a program that computes the circumference (perimeter) of the circle passing through all three points (its circumscribed circle).

Input

The input consists of several test cases. Each test case is a single line containing six real numbers x1,y1,x2,y2,x3,y3x_1, y_1, x_2, y_2, x_3, y_3 separated by spaces, giving the coordinates of the three points. Input continues until end of file (EOF). The diameter of the circle formed by the three points does not exceed 1,000,000.

Output

For each test case, print the circumference of the circle through the three points, rounded to two decimal places (rounding at the third decimal place). Use 3.1415926535897933.141592653589793 as the approximation of π\pi.

Examples2

  1. Example 1

    Input
    0.0 -0.5 0.5 0.0 0.0 0.5
    0.0 0.0 0.0 1.0 1.0 1.0
    5.0 5.0 5.0 7.0 4.0 6.0
    0.0 0.0 -1.0 7.0 7.0 7.0
    50.0 50.0 50.0 70.0 40.0 60.0
    0.0 0.0 10.0 0.0 20.0 1.0
    0.0 -500000.0 500000.0 0.0 0.0 500000.0
    
    Expected output
    3.14
    4.44
    6.28
    31.42
    62.83
    632.24
    3141592.65
    
  2. Example 2

    Input
    0.0 0.0 3.0 0.0 0.0 4.0
    
    Expected output
    15.71