I am writing a function to calculate radius, and the first input is centre of a circle and second is a point from the edge of the circle.
type Coord = (Int,Int)
getRadius :: Coord -> Coord -> Float
getRadius (x0,y0) (x1,y1) = sqrt(sqrX+sqrY)
where sqrX = (x1-x0)*(x1-x0)
sqrY = (y1-y0)*(y1-y0)
This is my code but when I compile it , an error shows that "Couldn't match expected type ‘Float’ with actual type ‘Int’. " I think the output should be a float not int . How can I fix this error? thanks
sqrt
. – Willem Van Onsem