#include <stdio.h>
#include <math.h>

int main(void) {
	int x, y, a, b;
	scanf("%d%d%d%d", &x, &y, &a, &b);
	double t, g, r, f;
	double s;
	t = x*sin(30.5*a);
	g = x*cos(30.5*a);
	r = y*sin(6*b);
	f = y*cos(6*b);
	s = sqrtf(pow(t-r,2) + pow(g-f,2));
	if(s < 0){
		s = -s;
	}
	printf("%f", s);
	return 0;
}
