Crustal stress determination from boreholes and rock cores: Fundamental principles