I tried to write a function where given two points (in degree), the Great-circle distance will be calculated. For this, degree has to be changed in radian.
beside the code is looking real ugly, ghci is giving me a parse error on input 'rad2grad' what i am doing wrong?
gke (x1, y1)(x2, y2) = c*rad2grad
where
c = 111.2225685
rad2grad = (360*arcos ((sin(grad2rad x1)*sin(grad2rad x2) + cos(grad2rad x1)*cos(grad2rad x2)*cos(grad2rad y1 - grad2rad y2)))/(2*pi)
grad2rad x1 = (2*pi/360)*x1
grad2rad x2 = (2*pi/360)*x2
grad2rad y1 = (2*pi/360)*y1
grad2rad y2 = (2*pi/360)*y2