I think we could get rid of the floating point math here. At least I don't exactly see why we need it, if you use "nDeltaX = wDeltaY * ptDeltaY / ptDeltaX" in the nDeltaX definition, similar to what you do in the nDeltaY definition. But probably not important anyway.