Problem D
Romeo & Juliet !
Input: Standard Input
Output: Standard Output
Time Limit: 2 seconds

 

In this problem we will discuss the problems of a modern Romeo and a modern Juliet. You are asked to solve their problems so that they don’t have to be a tragic pair like that of Shakespeare’s. As usual the family of Romeo and Juliet have hostile relationships and so they are locked up in two different places M and N. Two cannons are placed in location A and two cannons are placed in location B. One cannon of location A is aimed towards M and the other aimed towards N. The same thing applies to the two cannons of location B. The M and N are always on the opposite side of AB.

 


Fig: Partial Scenario of Romeo & Juliet

The movements of the cannons, which are aimed at M, are interrelated; the angle between their directions is constant. So angle CMD ((5 degree) <= (angle CMD) < (80 degree)) is constant. Same rule applies to the other two cannons. That’s angle ENF ((5 degree) <= (angle ENF) < (80 degree)) is also constant. All these things are shown in the picture above. But another important thing is missing in the figure above is that the locations N, A, M are always kept in a straight line. The reason behind this is very strange. A robot has been hired to guard Romeo and Juliet. It has two eyes at the opposite sides of its head and this robot is positioned in point A. To be precise, A, B and angle CMD and angle ENF are constants in one scenario and all other positions or values are variable. Also remember that point M must always remain pointed by the two cannons. Same thing applies to point N.

 

The problem is that in starry nights Mr. Romeo sings the song “Blue Nights” of “Michael Learns to Rock” in a loud voice and both parents don’t want Ms. Juliet to hear this song. So they want to place the houses (M and N) as far as possible preserving all the constraints explained before. Your job is to measure this maximum distance between M and N and inform it to Romeo, so that he can decide whether he should sing or not or what should be his voice level.

 

Input

The input file contains several lines of input. Each line contains six floating-point numbers, x1, y1, x2, and y2 (0<= x1, y1, x2, y2 <=10000) CMD, ENF. Here (x1, y1) is the coordinate of A, (x2, y2) is the coordinate of B, CMD is the angle between the directions of cannons pointed towards M and ENF is the similar value for point N. Input is terminated by end-of-file.

 

Output

For each line of input you should produce one line of output, which contains a floating-point number F. F is the maximum possible distance between Romeo’s house and Juliet’s house and it has three digits after the decimal point.

 

Sample Input:

10 10 10 20 48 48
10 10 20 20 60 70

 

Sample Output

18.008
13.312

Shahriar Manzoor