The file with following function:
type Point = (Float, Float)
type Circle = (Float, Float, Float)
getCircle :: Point -> Point -> Point -> Circle
getCircle (a, b) (c, d) (e, f) = (x, y, r)
where
x = ((a^2+b^2)*(f-d) + (c^2+d^2)*(b-f) + (e^2+f^2)*(d-b)) `div` (a*(f-d)+c*(b-f)+e*(d-b)) `div` 2
y = ((a^2+b^2)*(e-c) + (c^2+d^2)*(a-e) + (e^2+f^2)*(c-a)) `div` (b*(e-c)+d*(a-e)+f*(c-a)) `div` 2
r = sqrt ((a-x)^2 + (b-y)^2)
Throws an error when I try to load it to Hugs:
ERROR "/Users/ak/Desktop/1.hs":4 - Instance of Integral Float required for definition of getCircle
What's the essence of the problem and how can it be fixed? Thanks.