Change local position X and Y from global frame to local frame: using
flow rotation matrix