> can't typecast the varibles in function ?
Well you can, but that isn't going to help since the final result is still an integer (centre.x is an int), so you'll automatically lose any precious fractions at that point.