i-j to x-y