Flying square
Practice
3 (1 votes)
Circles
Mathematics
Medium
Geometry
Problem
82% Success 674 Attempts 30 Points 5s Time Limit 256MB Memory 1024 KB Max Code

You are given a square. Let's say that the point of intersection of diagonals of the square is a square centre. Square flies to the \(Y\)-axis in the direction perpendicular to \(Y\)-axis with the speed \(S\) meters per second. Every point of the square rotates by \(alpha\) degrees per second clockwise around the centre. Your goal is to find the first moment of time when the square touches the line.

It is guaranteed that tests are numerically stable, i.e. if we change some of the input parameters by a very small value \(eps\) \(< 10^{-9}\), then the \(|newAnswer - answer| < 10^{-6}\).

Input format

Each line \(i\) of the 4 subsequent lines (where \(1 \le i \le 4\)) contains two integers --- \((x_i, y_i)\), \((1 \le x_i, y_i \le 10^{3})\) describing \(i\)-th vertex of the square in the clockwise or counter-clockwise order. 
Next line contains one integer \(S\) \((1 \le S \le 10^{3})\) --- speed of the square.
Next line contains one integer \(alpha\) \((1 \le alpha < 360)\) --- rotation speed of the square.

Output format

Print one decimal number --- time needed for the square to touch the \(Y\)-axis with exactly 6 digits after the decimal point

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
No similar problems found