Thales visited Mesopotamia and Egypt and studied astronomy. He predicted the solar eclipse during a battle between the Lydeans and the Persians in 585 B.C.E. (A legend has it that he changed the course of the Halys River so that King Croesus could cross it). He is said to have been able to measure the height of the pyramids and distances at sea. His practical studies in engineering may have resulted in his creation of axioms, or abstract first principles, of the field of geometry. Thales was highly regarded for his wisdom.