The heart is located in the middle of the thoracic cavity, between the lungs, slightly tilted towards the left.