It is thought that the custom of removing or tipping your hat originates from the aforementioned medieval period, knights would raise their visors or remove their helmets as a gesture of good intent and in the same vein soldiers and the male hat wearing public would also raise their hats to their superiors. It was always the done thing for a man to raise his hat when he met a lady.
Many of these fine old traditions have long since faded into obscurity, and we as a society worse off for it I think. 'Manners' writes William Horman the 16th-century headmaster at Eton and Winchester College 'maketh man.'