ABCD is a convex quadrilateral. E, F, G, H are the midpoints of AB, BC, CD and DA respectively. EP and HP are the angle bisectors of ∠FEH and ∠EHG. x and y are the lengths of HP and EP. θ is equal to ∠BAD.
Your task is very simple. You are given the lengths of AB, BC, CD, DA and the angle θ. Find x and y.
Input starts with an integer T (≤ 10^5), denoting the number of test cases.
Each test case contains five integers AB, BC, CD, DA (1 ≤ AB, BC, CD, DA ≤ 10000) and θ in degrees (0 < θ < 180).
You can safely assume that every given quadrilateral is valid.
For each case, print a single line containing two floating point numbers which denote the values of x and y. Errors less than 10^-6 will be ignored.
Input | Output |
---|---|
2 2 2 2 2 90 2 2 2 2 45 | 1 1 0.5411961001 0.5411961001 |