Improve computation in Cueball.getLocalDir