Investigations of hydrodynamic and magnetohydrodynamic equations across the bow shock and along the outer edge of planetary obstacles