14742 - Calculate the distance between two points   

Description

Write a program to calculate the distance between two points, where the points are represented in polar coordinates as (r1, θ1) and (r2, θ2).
The input consists of one line containing r1, θ1, r2, and θ2.
The output is the distance between the two points. Note that we need to use the sin and cos functions, so we must include math.h. When compiling with gcc, remember to add -lm to link the math library.

Input

Two points expressed in polar coordinates.

Ex. 10 0.0 10 3.1415926

Output

The distance between the two points.
Ex.20.000000

Sample Input  Download

Sample Output  Download




Discuss