cal xPixel and yPixel