# Zhang Heng

Zhang Heng (Chinese: 張衡; AD 78–139), formerly romanized Chang Heng, was a Chinese Practical Man and statesman who lived during the Eastern Han dynasty. Educated in the capital cities of Luoyang and Chang'an, he achieved success as an astronomer, mathematician, seismologist, hydraulic engineer, inventor, geographer, cartographer, ethnographer, artist, poet, philosopher, politician, and literary scholar.
Zhang Heng began his career as a minor civil servant in Nanyang. Eventually, he became Chief Astronomer, Prefect of the Majors for Official Carriages, and then Palace Attendant at the imperial court. His uncompromising stance on historical and calendrical issues led to his becoming a controversial figure, preventing him from rising to the status of Grand Historian. His political rivalry with the palace eunuchs during the reign of Emperor Shun (r. 125–144) led to his decision to retire from the central court to serve as an administrator of Hejian Kingdom in present-day Hebei. Zhang returned home to Nanyang for a short time, before being recalled to serve in the capital once more in 138. He died there a year later, in 139.
Zhang applied his extensive knowledge of mechanics and gears in several of his inventions. He invented the world's first water-powered armillary sphere to assist astronomical observation; improved the inflow water clock by adding another tank; and invented the world's first seismoscope, which discerned the cardinal direction of an earthquake 500 km (310 mi) away. He improved previous Chinese calculations for pi. In addition to documenting about 2,500 stars in his extensive star catalog, Zhang also posited theories about the Moon and its relationship to the Sun: specifically, he discussed the Moon's sphericity, its illumination by reflected sunlight on one side and the hidden nature of the other, and the nature of solar and lunar eclipses. His fu (rhapsody) and shi poetry were renowned in his time and studied and analyzed by later Chinese writers. Zhang received many posthumous honors for his scholarship and ingenuity; some modern scholars have compared his work in astronomy to that of the Greco-Roman Ptolemy (AD 86–161).

## Life
### Early life

Born in the town of shing shong in Nanyang Commandery (north of the modern Nanyang City in Henan province), Zhang Heng came from a distinguished but not affluent family. His grandfather Zhang Kan (張堪) had been governor of a commandery and one of the leaders who supported the restoration of the Han by Emperor Guangwu (r. 25–57), following the death of the usurping Wang Mang of the Xin (AD 9–23). When he was ten, Zhang's father died, leaving him in the care of his mother and grandmother.
An accomplished writer in his youth, Zhang left home in the year 95 to pursue his studies in the capitals of Chang'an and Luoyang. While traveling to Luoyang, Zhang passed by a hot spring near Mount Li and dedicated one of his earliest fu poems to it. This work, entitled "Fu on the Hot Springs" (Wēnquán fù 溫泉賦), describes the throngs of people attending the hot springs, which later became famous as the "Huaqing Hot Springs", a favorite retreat of imperial concubine Yang Guifei during the Tang dynasty. After studying for some years at Luoyang's Taixue, he was well-versed in the classics and friends with several notable persons, including the mathematician and calligrapher Cui Yuan (78–143), the official and philosophical commentator Ma Rong (79–166), and the philosopher Wang Fu (78–163). Government authorities offered Zhang appointments to several offices, including a position as one of the Imperial Secretaries, yet he acted modestly and declined.
At age 23, Zhang returned home with the title "Officer of Merit in Nanyang", serving as the master of documents under the administration of Governor Bao De (in office from 103 to 111). As he was charged with composing inscriptions and dirges for the governor, he gained experience in writing official documents. As Officer of Merit in the commandery, he was also responsible for local appointments to office and recommendations to the capital of nominees for higher office. He spent much of his time composing rhapsodies on the capital cities. When Bao De was recalled to the capital in 111 to serve as a minister of finance, Zhang continued his literary work at home in Xi'e. Zhang Heng began his studies in astronomy at the age of 30 and began publishing his works on astronomy and mathematics.

### Official career

In 112, Zhang was summoned to the court of Emperor An (r. 106–125), who had heard of his expertise in mathematics. When he was nominated to serve at the capital, Zhang was escorted by carriage—a symbol of his official status—to Luoyang, where he became a court gentleman working for the Imperial Secretariat. He was promoted to Chief Astronomer for the court, serving his first term from 115 to 120 under Emperor An and his second under the succeeding emperor from 126 to 132. As Chief Astronomer, Zhang was a subordinate of the Minister of Ceremonies, one of Nine Ministers ranked just below the Three Excellencies. In addition to recording heavenly observations and portents, preparing the calendar, and reporting which days were auspicious and which ill-omened, Zhang was also in charge of an advanced literacy test for all candidates to the Imperial Secretariat and the Censorate, both of whose members were required to know at least 9,000 characters and all major writing styles. Under Emperor An, Zhang also served as Prefect of the Majors for Official Carriages under the Ministry of Guards, in charge of receiving memorials to the throne (formal essays on policy and administration) as well as nominees for official appointments.
When the government official Dan Song proposed the Chinese calendar should be reformed in 123 to adopt certain apocryphal teachings, Zhang opposed the idea. He considered the teachings to be of questionable stature and believed they could introduce errors. Others shared Zhang's opinion and the calendar was not altered, yet Zhang's proposal that apocryphal writings should be banned was rejected. The officials Liu Zhen and Liu Taotu, members of a committee to compile the dynastic history Dongguan Hanji (東觀漢記), sought permission from the court to consult Zhang Heng. However, Zhang was barred from assisting the committee due to his controversial views on apocrypha and his objection to the relegation of the Gengshi Emperor's (r. 23–25) role in the restoration of the Han dynasty as lesser than Emperor Guangwu's. Liu Zhen and Liu Taotu were Zhang's only historian allies at court, and after their deaths Zhang had no further opportunities for promotion to the prestigious post of court historian.
Despite this setback in his official career, Zhang was reappointed as Chief Astronomer in 126 after Emperor Shun of Han (r. 125–144) ascended to the throne. His intensive astronomical work was rewarded only with the rank and salary of 600 bushels, or shi, of grain (mostly commuted to coin cash or bolts of silk). To place this number in context, in a hierarchy of twenty official ranks, the lowest-paid official earned the rank and salary of 100 bushels and the highest-paid official earned 10,000 bushels during the Han. The 600-bushel rank was the lowest the emperor could directly appoint to a central government position; any official of lower status was overseen by central or provincial officials of high rank.
In 132, Zhang introduced an intricate seismoscope to the court, which he claimed could detect the precise cardinal direction of a distant earthquake. On one occasion his device indicated that an earthquake had occurred in the northwest. As there was no perceivable tremor felt in the capital his political enemies were briefly able to relish the failure of his device, until a messenger arrived shortly afterwards to report that an earthquake had occurred about 400 km (248 mi) to 500 km (310 mi) northwest of Luoyang in Gansu province.
A year after Zhang presented his seismoscope to the court, officials and candidates were asked to provide comments about a series of recent earthquakes which could be interpreted as signs of displeasure from Heaven. The ancient Chinese viewed natural calamities as cosmological punishments for misdeeds that were perpetrated by the Chinese ruler or his subordinates on earth. In Zhang's memorial discussing the reasons behind these natural disasters, he criticized the new recruitment system of Zuo Xiong which fixed the age of eligible candidates for the title "Filial and Incorrupt" at age forty. The new system also transferred the power of the candidates' assessment to the Three Excellencies rather than the Generals of the Household, who by tradition oversaw the affairs of court gentlemen. Although Zhang's memorial was rejected, his status was significantly elevated soon after to Palace Attendant, a position he used to influence the decisions of Emperor Shun. With this prestigious new position, Zhang earned a salary of 2,000 bushels and had the right to escort the emperor.
As Palace Attendant to Emperor Shun, Zhang Heng attempted to convince him that the court eunuchs represented a threat to the imperial court. Zhang pointed to specific examples of past court intrigues involving eunuchs, and convinced Shun that he should assume greater authority and limit their influence. The eunuchs attempted to slander Zhang, who responded with a fu rhapsody called "Fu on Pondering the Mystery", which vents his frustration. Rafe de Crespigny states that Zhang's rhapsody used imagery similar to Qu Yuan's (340–278 BC) poem "Li Sao" and focused on whether or not good men should flee the corrupted world or remain virtuous within it.

## Literature and poetry

While working for the central court, Zhang Heng had access to a variety of written materials located in the Archives of the Eastern Pavilion. Zhang read many of the great works of history in his day and claimed he had found ten instances where the Records of the Grand Historian by Sima Qian (145–90 BC) and the Book of Han by Ban Gu (AD 32–92) differed from other ancient texts that were available to him. His account was preserved and recorded in the 5th-century text of the Book of Later Han by Fan Ye (398–445). His rhapsodies and other literary works displayed a deep knowledge of classic texts, Chinese philosophy, and histories. He also compiled a commentary on the Taixuan (太玄, "Great Mystery") by the Daoist author Yang Xiong (53 BC–AD 18).
Xiao Tong (501–531), a crown prince of the Liang dynasty (502–557), immortalized several of Zhang's works in his literary anthology Selections of Refined Literature. Zhang's fu rhapsodies include "Western Metropolis Rhapsody" (Xī jīng fù 西京賦), "Eastern Metropolis Rhapsody" (Dōng jīng fù 東京賦), "Southern Capital Rhapsody" (Nán dū fù 南都賦), "Rhapsody on Contemplating the Mystery" (Sī xuán fù 思玄賦), and Return to the Field. The latter fuses Daoist ideas with Confucianism and was a precursor to later Chinese metaphysical nature poetry, according to Liu Wu-chi. A set of four short lyric poems entitled Lyric Poems on Four Sorrows (Sì chóu shī 四愁詩), is also included with Zhang's preface. This set constitutes some of the earliest heptasyllabic shi Chinese poetry written. While still in Luoyang, Zhang became inspired to write his "Western Metropolis Rhapsody" and "Eastern Metropolis Rhapsody", which were based on the "Rhapsody on the Two Capitals" by the historian Ban Gu. Zhang's work was similar to Ban's, although the latter fully praised the contemporaneous Eastern Han regime while Zhang provided a warning that it could suffer the same fate as the Western Han if it too declined into a state of decadence and moral depravity. These two works satirized and criticized what he saw as the excessive luxury of the upper classes. Zhang's "Southern Capital Rhapsody" commemorated his home city of Nanyang, home of the restorer of the Han dynasty, Guangwu.
In Zhang Heng's poem "Four Sorrows", he laments that he is unable to woo a beautiful woman due to the impediment of mountains, snows and rivers. Scholars Rafe de Crespigny and David R. Knechtges claim that Zhang wrote this as an innuendo hinting at his inability to keep in contact with the emperor, hindered by unworthy rivals and petty men. This poem is one of the first in China to have seven words per line. His "Four Sorrows" reads:
In another poem of his called "Stabilizing the Passions" (Dìng qíng fù 定情賦)—preserved in a Tang dynasty (618–907) encyclopedia, but referred to earlier by Tao Qian (365–427) in praise of Zhang's lyrical minimalism—Zhang displays his admiration for an attractive and exemplary woman. This simpler type of fu poem influenced later works by the prominent official and scholar Cai Yong (132–192). Zhang wrote:
Zhang's long lyrical poems also revealed a great amount of information on urban layout and basic geography. His rhapsody "Sir Based-On-Nothing" provides details on terrain, palaces, hunting parks, markets, and prominent buildings of Chang'an, the Western Han capital. Exemplifying his attention to detail, his rhapsody on Nanyang described gardens filled with spring garlic, summer bamboo shoots, autumn leeks, winter rape-turnips, perilla, evodia, and purple ginger. Along with Sima Xiangru (179–117 BC), Zhang listed a variety of animals and hunting game inhabiting the park, which were divided in the northern and southern portions of the park according to where the animals had originally come from: northern or southern China. Somewhat similar to the description of Sima Xiangru, Zhang described the Western Han emperors and their entourage enjoying boat outings, water plays, fishing, and displays of archery targeting birds and other animals with stringed arrows from the tops of tall towers along Chang'an's Kunming Lake. The focus of Zhang's writing on specific places and their terrain, society, people, and their customs could also be seen as early attempts of ethnographic categorization. In his poem "Xijing fu", Zhang shows that he was aware of the new foreign religion of Buddhism, introduced via the Silk Road, as well as the legend of the birth of Buddha with the vision of the white elephant bringing about conception. In his "Western Metropolis Rhapsody" (西京賦), Zhang described court entertainments such as juedi (角抵), a form of theatrical wrestling accompanied by music in which participants butted heads with bull horn masks.
With his "Responding to Criticism" (Ying jian 應間), a work modeled on Yang Xiong's "Justification Against Ridicule", Zhang was an early writer and proponent of the Chinese literary genre shelun, or hypothetical discourse. Authors of this genre created a written dialogue between themselves and an imaginary person (or a real person of their entourage or association); the latter poses questions to the author on how to lead a successful life. He also used it as a means to criticize himself for failing to obtain high office, but coming to the conclusion that the true gentleman displays virtue instead of greed for power. In this work, Dominik Declercq asserts that the person urging Zhang to advance his career in a time of government corruption most likely represented the eunuchs or Empress Liang's (116–150) powerful relatives in the Liang clan. Declercq states that these two groups would have been "anxious to know whether this famous scholar could be lured over to their side", but Zhang flatly rejected such an alignment by declaring in this politically charged piece of literature that his gentlemanly quest for virtue trumped any desire of his for power.
Zhang wrote about the various love affairs of emperors dissatisfied with the imperial harem, going out into the city incognito to seek out prostitutes and sing-song girls. This was seen as a general criticism of the Eastern Han emperors and their imperial favorites, guised in the criticism of earlier Western Han emperors. Besides criticizing the Western Han emperors for lavish decadence, Zhang also pointed out that their behavior and ceremonies did not properly conform with the Chinese cyclical beliefs in yin and yang. In a poem criticizing the previous Western Han dynasty, Zhang wrote:

## Achievements in science and technology
### Mathematics

For centuries the Chinese approximated pi as 3; Liu Xin (d. CE 23) made the first known Chinese attempt at a more accurate calculation of 3.154, but there is no record detailing the method he used to obtain this figure. In his work around 130, Zhang Heng compared the celestial circle to the diameter of the earth, proportioning the former as 736 and the latter as 232, thus calculating pi as 3.1724. In Zhang's day, the ratio 4:3 was given for the area of a square to the area of its inscribed circle and the volume of a cube and volume of the inscribed sphere should also be 4$^2$:3$^2$. In formula, with D as diameter and V as volume, D$^3$:V = 16:9 or V=${\tfrac {9}{16}}$D$^3$; Zhang realized that the value for diameter in this formula was inaccurate, noting the discrepancy as the value taken for the ratio. Zhang then attempted to remedy this by amending the formula with an additional ${\tfrac {1}{16}}$D$^3$, hence V=${\tfrac {9}{16}}$D$^3$ + ${\tfrac {1}{16}}$D$^3$ = ${\tfrac {5}{8}}$D$^3$. With the ratio of the volume of the cube to the inscribed sphere at 8:5, the implied ratio of the area of the square to the circle is √8:√5. From this formula, Zhang calculated pi as the square root of 10 (or approximately 3.162). In the 3rd century, Liu Hui made the calculation more accurate with his π algorithm, which allowed him to obtain the value 3.14159. Later, Zu Chongzhi (429–500) approximated pi as ${\tfrac {355}{113}}$ or 3.141592, the most accurate calculation for pi the ancient Chinese would achieve.

### Astronomy

In his publication of AD 120 called The Spiritual Constitution of the Universe (靈憲, Ling Xian, lit. "Sublime Model"), Zhang Heng theorized that the universe was like an egg "as round as a crossbow pellet" with the stars on the shell and the Earth as the central yolk. This universe theory is congruent with the geocentric model as opposed to the heliocentric model. Although the ancient Warring States (403–221 BC) Chinese astronomers Shi Shen and Gan De had compiled China's first star catalogue in the 4th century BC, Zhang nonetheless catalogued 2,500 stars which he placed in a "brightly shining" category (the Chinese estimated the total to be 14,000), and he recognized 124 constellations. In comparison, this star catalogue featured many more stars than the 850 documented by the Greek astronomer Hipparchus (c. 190 – c. 120 BC) in his catalogue, and more than Ptolemy (AD 83–161), who catalogued over 1,000. Zhang supported the "radiating influence" theory to explain solar and lunar eclipses, a theory which was opposed by Wang Chong (AD 27–97). In the Ling Xian, Zhang wrote:
   夫日譬猶火，月譬猶水，火則外光，水則含景。故月光生於日之所照，魄生於日之所蔽，當日則光盈，就日則光盡也。 The Sun is like fire and the Moon like water. The fire gives out light and the water reflects it. Thus the Moon's brightness is produced from the radiance of the Sun, and the Moon's darkness is due to (the light of) the Sun being obstructed. The side which faces the Sun is fully lit, and the side which is away from it is dark.
   衆星被燿，因水轉光。當日之衝，光常不合者，蔽於地也。是謂闇虛。在星星微，月過則食。 The planets (as well as the Moon) have the nature of water and reflect light. The light pouring forth from the Sun does not always reach the Moon owing to the obstruction of the Earth itself—this is called "ànxū", a lunar eclipse. When (a similar effect) happens with a planet (we call it) an occultation; when the Moon passes across (the Sun's path) then there is a solar eclipse.
Zhang Heng viewed these astronomical phenomena in supernatural terms as well. The signs of comets, eclipses, and movements of heavenly bodies could all be interpreted by him as heavenly guides on how to conduct affairs of state. Contemporary writers also wrote about eclipses and the sphericity of heavenly bodies. The music theorist and mathematician Jing Fang (78–37 BC) wrote about the spherical shape of the Sun and Moon while discussing eclipses:
   The Moon and the planets are Yin; they have shape but no light. This they receive only when the Sun illuminates them. The former masters regarded the Sun as round like a crossbow bullet, and they thought the Moon had the nature of a mirror. Some of them recognized the Moon as a ball too. Those parts of the Moon which the Sun illuminates look bright, those parts which it does not, remain dark.
The theory posited by Zhang and Jing was supported by later pre-modern scientists such as Shen Kuo (1031–1095), who expanded on the reasoning of why the Sun and Moon were spherical. The theory of the celestial sphere surrounding a flat, square Earth was later criticized by the Jin-dynasty scholar-official Yu Xi (fl. 307–345). He suggested that the Earth could be round like the heavens, a spherical Earth theory fully accepted by mathematician Li Ye (1192–1279) but not by mainstream Chinese science until European influence in the 17th century.

### Extra tank for inflow clepsydra

The outflow clepsydra was a timekeeping device used in China as long ago as the Shang dynasty (c. 1600–c. 1050 BC), and certainly by the Zhou dynasty (1122–256 BC). The inflow clepsydra with an indicator rod on a float had been known in China since the beginning of the Han dynasty in 202 BC and had replaced the outflow type. The Han Chinese noted the problem with the falling pressure head in the reservoir, which slowed the timekeeping of the device as the inflow vessel was filled. Zhang Heng was the first to address this problem, indicated in his writings from 117, by adding an extra compensating tank between the reservoir and the inflow vessel. Zhang also mounted two statuettes of a Chinese immortal and a heavenly guard on the top of the inflow clepsydra, the two of which would guide the indicator rod with their left hand and point out the graduations with their right. Joseph Needham states that this was perhaps the ancestor of all clock jacks that would later sound the hours found in mechanical clocks by the 8th century, but he notes that these figures did not actually move like clock jack figurines or sound the hours. Many additional compensation tanks were added to later clepsydras in the tradition of Zhang Heng. In 610 the Sui dynasty (581–618) engineers Geng Xun and Yuwen Kai crafted an unequal-armed steelyard balance able to make seasonal adjustments in the pressure head of the compensating tank, so that it could control the rate of water flow for different lengths of day and night during the year. Zhang mentioned a "jade dragon's neck", which in later times meant a siphon. He wrote of the floats and indicator-rods of the inflow clepsydra as follows:
   以銅為器，再疊差置，實以清水，下各開孔，以玉虯吐漏水入兩壺。右為夜，左為晝。 Bronze vessels are made and placed one above the other at different levels; they are filled with pure water. Each has at the bottom a small opening in the form of a 'jade dragon's neck'. The water dripping (from above) enters two inflow receivers (alternately), the left one being for the night and the right one for the day.
   蓋上又鑄金銅仙人，居左壺；為胥徒，居右壺。皆以左手抱箭，右手指刻，以別天時早晚。 On the covers of each (inflow receiver) there are small cast statuettes in gilt bronze; the left (night) one is an immortal and the right (day) one is a policeman. These figures guide the indicator-rod (lit. arrow) with their left hands, and indicate the graduations on it with their right hands, thus giving the time.

### Water-powered armillary sphere

Zhang Heng is the first person known to have applied hydraulic motive power (i.e. by employing a waterwheel and clepsydra) to rotate an armillary sphere, an astronomical instrument representing the celestial sphere. The Greek astronomer Eratosthenes (276–194 BC) invented the first armillary sphere in 255 BC. The Chinese armillary sphere was fully developed by 52 BC, with the astronomer Geng Shouchang's (耿壽昌) addition of a permanently fixed equatorial ring. In AD 84 the astronomers Fu An and Jia Kui added the ecliptic ring, and finally Zhang Heng added the horizon and meridian rings. This invention is described and attributed to Zhang in quotations by Hsu Chen and Li Shan, referencing his book Lou Shui Chuan Hun Thien I Chieh (Apparatus for Rotating an Armillary Sphere by Clepsydra Water). It was likely not an actual book by Zhang, but a chapter from his Hun I or Hun I Thu Chu, written in 117 AD. His water-powered armillary influenced the design of later Chinese water clocks and led to the discovery of the escapement mechanism by the 8th century. The historian Joseph Needham (1900–1995) states:
   What were the factors leading to the first escapement clock in China? The chief tradition leading to Yi Xing (AD 725 ) was of course the succession of 'pre-clocks' which had started with Zhang Heng about 125. Reason has been given for believing that these applied power to the slow turning movement of computational armillary spheres and celestial globes by means of a water-wheel using clepsydra drip, which intermittently exerted the force of a lug to act on the teeth of a wheel on a polar-axis shaft. Zhang Heng in his turn had composed this arrangement by uniting the armillary rings of his predecessors into the equatorial armillary sphere, and combining it with the principles of the water-mills and hydraulic trip-hammers which had become so widespread in Chinese culture in the previous century.
Zhang did not initiate the Chinese tradition of hydraulic engineering, which began during the mid Zhou dynasty (c. 6th century BC), through the work of engineers such as Sunshu Ao and Ximen Bao. Zhang's contemporary, Du Shi, (d. AD 38) was the first to apply the motive power of waterwheels to operate the bellows of a blast furnace to make pig iron, and the cupola furnace to make cast iron. Zhang provided a valuable description of his water-powered armillary sphere in the treatise of 125, stating:
   The equatorial ring goes around the belly of the armillary sphere 91 and 5/19 (degrees) away from the pole. The circle of the ecliptic also goes round the belly of the instrument at an angle of 24 (degrees) with the equator. Thus at the summer solstice the ecliptic is 67 (degrees) and a fraction away from the pole, while at the winter solstice it is 115 (degrees) and a fraction away. Hence (the points) where the ecliptic and the equator intersect should give the north polar distances of the spring and autumn equinoxes. But now (it has been recorded that) the spring equinox is 90 and 1/4 (degrees) away from the pole, and the autumn equinox is 92 and 1/4 (degrees) away. The former figure is adopted only because it agrees with the (results obtained by the) method of measuring solstitial sun shadows as embodied in the Xia (dynasty) calendar.
Zhang Heng's water-powered armillary sphere had profound effects on Chinese astronomy and mechanical engineering in later generations. His model and its complex use of gears greatly influenced the water-powered instruments of later astronomers such as Yi Xing (683–727), Zhang Sixun (fl. 10th century), Su Song (1020–1101), Guo Shoujing (1231–1316), and many others. Water-powered armillary spheres in the tradition of Zhang Heng's were used in the eras of the Three Kingdoms (220–280) and Jin dynasty (266–420), yet the design for it was temporarily out of use between 317 and 418, due to invasions of northern Xiongnu nomads. Zhang Heng's old instruments were recovered in 418, when Emperor Wu of Liu Song (r. 420–422) captured the ancient capital of Chang'an. Although still intact, the graduation marks and the representations of the stars, Moon, Sun, and planets were quite worn down by time and rust. In 436, the emperor ordered Qian Luozhi, the Secretary of the Bureau of Astronomy and Calendar, to recreate Zhang's device, which he managed to do successfully. Qian's water-powered celestial globe was still in use at the time of the Liang dynasty (502–557), and successive models of water-powered armillary spheres were designed in subsequent dynasties.

### Zhang's seismoscope

From the earliest times, the Chinese were concerned with the destructive force of earthquakes. It was recorded in Sima Qian's Records of the Grand Historian of 91 BC that in 780 BC an earthquake had been powerful enough to divert the courses of three rivers. It was not known at the time that earthquakes were caused by the shifting of tectonic plates in the Earth's crust; instead, the people of the ancient Zhou dynasty explained them as disturbances with cosmic yin and yang, along with the heavens' displeasure with acts committed (or the common peoples' grievances ignored) by the current ruling dynasty. These theories were ultimately derived from the ancient text of the Yijing, in its fifty-first hexagram. There were other early theories about earthquakes, developed by those such as the ancient Greeks. Anaxagoras (c. 500–428 BC) believed that they were caused by excess water near the surface crust of the earth bursting into the Earth's hollows; Democritus (c. 460–370 BC) believed that the saturation of the Earth with water caused them; Anaximenes (c. 585–c. 525 BC) believed they were the result of massive pieces of the Earth falling into the cavernous hollows due to drying; and Aristotle (384–322 BC) believed they were caused by instability of vapor (pneuma) caused by the drying of the moist Earth by the Sun's rays.
During the Han dynasty, many learned scholars—including Zhang Heng—believed in the "oracles of the winds". These oracles of the occult observed the direction, force, and timing of the winds, to speculate about the operation of the cosmos and to predict events on Earth. These ideas influenced Zhang Heng's views on the cause of earthquakes.
In 132, Zhang Heng presented to the Han court what many historians consider to be his most impressive invention, the first seismoscope. A seismoscope records the motions of Earth's shaking, but unlike a seismometer, it does not retain a time record of those motions. It was named "earthquake weathervane" (hòufēng dìdòngyí 候風地動儀), and it was able to roughly determine the direction (out of eight directions) where the earthquake came from. According to the Book of Later Han (compiled by Fan Ye in the 5th century), his bronze urn-shaped device, with a swinging pendulum inside, was able to detect the direction of an earthquake hundreds of miles/kilometers away. This was essential for the Han government in sending quick aid and relief to regions devastated by this type of natural disaster. The Book of Later Han records that, on one occasion, Zhang's device was triggered, though no observer had felt any seismic disturbance; several days later a messenger arrived from the west and reported that an earthquake had occurred in Longxi (modern Gansu Province), the same direction that Zhang's device had indicated, and thus the court was forced to admit the efficacy of the device.
To indicate the direction of a distant earthquake, Zhang's device dropped a bronze ball from one of eight tubed projections shaped as dragon heads; the ball fell into the mouth of a corresponding metal object shaped as a toad, each representing a direction like the points on a compass rose. His device had eight mobile arms (for all eight directions) connected with cranks having catch mechanisms at the periphery. When tripped, a crank and right angle lever would raise a dragon head and release a ball which had been supported by the lower jaw of the dragon head. His device also included a vertical pin passing through a slot in the crank, a catch device, a pivot on a projection, a sling suspending the pendulum, an attachment for the sling, and a horizontal bar supporting the pendulum. Wang Zhenduo argued that the technology of the Eastern Han era was sophisticated enough to produce such a device, as evidenced by contemporary levers and cranks used in other devices such as crossbow triggers.
Later Chinese of subsequent periods were able to reinvent Zhang's seismoscope. They included the 6th-century mathematician and surveyor Xindu Fang of the Northern Qi dynasty (550–577) and the astronomer and mathematician Lin Xiaogong of the Sui dynasty (581–618). Like Zhang, Xindu Fang and Lin Xiaogong were given imperial patronage for their services in craftsmanship of devices for the court. By the time of the Yuan dynasty (1271–1368), it was acknowledged that all devices previously made were preserved, except for that of the seismoscope. This was discussed by the scholar Zhou Mi around 1290, who remarked that the books of Xindu Fang and Lin Xiaogong detailing their seismological devices were no longer to be found. Horwitz, Kreitner, and Needham speculate if Tang dynasty (618–907) era seismographs found their way to contemporary Japan; according to Needham, "instruments of apparently traditional type there in which a pendulum carries pins projecting in many directions and able to pierce a surrounding paper cylinder, have been described."
Hong-sen Yan states that modern replicas of Zhang's device have failed to reach the level of accuracy and sensitivity described in Chinese historical records. Wang Zhenduo presented two different models of the seismoscope based on the ancient descriptions of Zhang's device. In his 1936 reconstruction, the central pillar (du zhu) of the device was a suspended pendulum acting as a movement sensor, while the central pillar of his second model in 1963 was an inverted pendulum. According to Needham, while working in the Seismological Observatory of Tokyo University in 1939, Akitsune Imamura and Hagiwara made a reconstruction of Zhang's device. While it was John Milne and Wang Zhenduo who argued early on that Zhang's "central pillar" was a suspended pendulum, Imamura was the first to propose an inverted model. He argued that transverse shock would have rendered Wang's immobilization mechanism ineffective, as it would not have prevented further motion that could knock other balls out of their position. On June 13, 2005, modern Chinese seismologists announced that they had successfully created a replica of the instrument.
Anthony J. Barbieri-Low, a professor of early Chinese history at the University of California, Santa Barbara, names Zhang Heng as one of several high-ranking Eastern-Han officials who engaged in crafts that were traditionally reserved for artisans (gong 工), such as mechanical engineering. Barbieri-Low speculates that Zhang only designed his seismoscope, but did not actually craft the device himself. He asserts that this would most likely have been the job of artisans commissioned by Zhang. He writes: "Zhang Heng was an official of moderately high rank and could not be seen sweating in the foundries with the gong artisans and the government slaves. Most likely, he worked collaboratively with the professional casters and mold makers in the imperial workshops."

### Cartography

The Wei (220–265) and Jin dynasty (266–420) cartographer and official Pei Xiu (224–271) was the first in China to describe in full the geometric grid reference for maps that allowed for precise measurements using a graduated scale, as well as topographical elevation. However, map-making in China had existed since at least the 4th century BC with the Qin state maps found in Gansu in 1986. Pinpointed accuracy of the winding courses of rivers and familiarity with scaled distance had been known since the Qin and Han dynasty, respectively, as evidenced by their existing maps, while the use of a rectangular grid had been known in China since the Han as well. Historian Howard Nelson states that, although the accounts of Zhang Heng's work in cartography are somewhat vague and sketchy, there is ample written evidence that Pei Xiu derived the use of the rectangular grid reference from the maps of Zhang Heng. Rafe de Crespigny asserts that it was Zhang who established the rectangular grid system in Chinese cartography. Needham points out that the title of his book Flying Bird Calendar may have been a mistake, and that the book is more accurately entitled Bird's Eye Map. Historian Florian C. Reiter notes that Zhang's narrative "Guitian fu" contains a phrase about applauding the maps and documents of Confucius of the Zhou dynasty, which Reiter suggests places maps (tu) on a same level of importance with documents (shu). It is documented that a physical geography map was first presented by Zhang Heng in 116 AD, called a Dixingtu (地形圖).

### Odometer and south-pointing chariot

Zhang Heng is often credited with inventing the first odometer, an achievement also attributed to Archimedes (c. 287–212 BC) and Heron of Alexandria (fl. AD 10–70). Similar devices were used by the Roman and Han-Chinese empires at about the same period. By the 3rd century, the Chinese had termed the device the jili guche (記里鼓車, "li-recording drum carriage" (the modern measurement of li = 500 m/1640 ft).
Ancient Chinese texts describe the mechanical carriage's functions; after one li was traversed, a mechanically driven wooden figure struck a drum, and after ten li had been covered, another wooden figure struck a gong or a bell with its mechanically operated arm. However, there is evidence to suggest that the invention of the odometer was a gradual process in Han dynasty China that centered on the "huang men"—court people (i.e. eunuchs, palace officials, attendants and familiars, actors, acrobats, etc.) who followed the musical procession of the royal "drum-chariot". There is speculation that at some time during the 1st century BC the beating of drums and gongs was mechanically driven by the rotation of the road wheels. This might have actually been the design of Luoxia Hong (c. 110 BC), yet by at least 125 the mechanical odometer carriage was already known, as it was depicted in a mural of the Xiao Tang Shan Tomb.
The south-pointing chariot was another mechanical device credited to Zhang Heng. It was a non-magnetic compass vehicle in the form of a two-wheeled chariot. Differential gears driven by the chariot's wheels allowed a wooden figurine (in the shape of a Chinese state minister) to constantly point to the south, hence its name. The Song Shu (c. AD 500 ) records that Zhang Heng re-invented it from a model used in the Zhou dynasty era, but the violent collapse of the Han dynasty unfortunately did not allow it to be preserved. Whether Zhang Heng invented it or not, Ma Jun (200–265) succeeded in creating the chariot in the following century.

## Legacy
### Science and technology

Zhang Heng's mechanical inventions influenced later Chinese inventors such as Yi Xing, Zhang Sixun, Su Song, and Guo Shoujing. Su Song directly named Zhang's water-powered armillary sphere as the inspiration for his 11th-century clock tower. The cosmic model of nine points of Heaven corresponding with nine regions of earth conceived in the work of the scholar-official Chen Hongmou (1696–1771) followed in the tradition of Zhang's book Spiritual Constitution of the Universe. The seismologist John Milne, who created the modern seismograph in 1876 alongside Thomas Gray and James A. Ewing at the Imperial College of Engineering in Tokyo, commented in 1886 on Zhang Heng's contributions to seismology. The historian Joseph Needham emphasized his contributions to pre-modern Chinese technology, stating that Zhang was noted even in his day for being able to "make three wheels rotate as if they were one." More than one scholar has described Zhang as a polymath. However, some scholars also point out that Zhang's writing lacks concrete scientific theories. Comparing Zhang with his contemporary, Ptolemy (83–161) of Roman Egypt, Jin Guantao, Fan Hongye, and Liu Qingfeng state:
       Based on the theories of his predecessors, Zhang Heng systematically developed the celestial sphere theory. An armillary constructed on the basis of his hypotheses bears a remarkable similarity to Ptolemy's earth-centered theory. However, Zhang Heng did not definitely propose a theoretical model like Ptolemy's earth-centered one. It is astonishing that the celestial model Zhang Heng constructed was almost a physical model of Ptolemy's earth-centered theory. Only a single step separates the celestial globe from the earth-centered theory, but Chinese astronomers never took that step.
       Here we can see how important the exemplary function of the primitive scientific structure is. In order to use the Euclidean system of geometry as a model for the development of astronomical theory, Ptolemy first had to select hypotheses which could serve as axioms. He naturally regarded circular motion as fundamental and then used the circular motion of deferents and epicycles in his earth-centered theory. Although Zhang Heng understood that the sun, moon and planets move in circles, he lacked a model for a logically structured theory and so could not establish a corresponding astronomical theory. Chinese astronomy was most interested in extracting the algebraic features of planetary motion (that is, the length of the cyclic periods) to establish astronomical theories. Thus astronomy was reduced to arithmetic operations, extracting common multiples and divisors from the observed cyclic motions of the heavenly bodies.

### Poetic literature

Zhang's poetry was widely read during his life and after his death. In addition to the compilation of Xiao Tong mentioned above, the Eastern Wu official Xue Zong (d. 237) wrote commentary on Zhang's poems "Dongjing fu" and "Xijing fu". The influential poet Tao Qian wrote that he admired the poetry of Zhang Heng for its "curbing extravagant diction and aiming at simplicity", in regards to perceived tranquility and rectitude correlating with the simple but effective language of the poet. Tao wrote that both Zhang Heng and Cai Yong "avoided inflated language, aiming chiefly at simplicity", and adding that their "compositions begin by giving free expression to their fancies but end on a note of quiet, serving admirably to restrain undisciplined and passionate nature".

### Posthumous honors

Zhang was given great honors in life and in death. The philosopher and poet Fu Xuan (217–278) of the Wei and Jin dynasties once lamented in an essay over the fact that Zhang Heng was never placed in the Ministry of Works. Writing highly of Zhang and the 3rd-century mechanical engineer Ma Jun, Fu Xuan wrote, "Neither of them was ever an official of the Ministry of Works, and their ingenuity did not benefit the world. When (authorities) employ personnel with no regard to special talent, and having heard of genius neglect even to test it—is this not hateful and disastrous?"
In honor of Zhang's achievements in science and technology, his friend Cui Ziyu (Cui Yuan) wrote a memorial inscription on his burial stele, which has been preserved in the Guwen yuan. Cui stated, "[Zhang Heng's] mathematical computations exhausted (the riddles of) the heavens and the earth. His inventions were comparable even to those of the Author of Change. The excellence of his talent and the splendour of his art were one with those of the gods." The minor official Xiahou Zhan (243–291) of the Wei dynasty made an inscription for his own commemorative stele to be placed at Zhang Heng's tomb. It read: "Ever since gentlemen have composed literary texts, none has been as skillful as the Master [Zhang Heng] in choosing his words well ... if only the dead could rise, oh I could then turn to him for a teacher!"
Several things have been named after Zhang in modern times, including the lunar crater Chang Heng, the asteroid 1802 Zhang Heng, and the mineral zhanghengite. In 2018, China launched a research satellite called China Seismo-Electromagnetic Satellite (CSES) which is also named Zhangheng-1 (ZH-1).