minor optimisation, fewer floats in coordinate calculations