1. Inputs the calculator needs
- Birth date — solar (Gregorian) or Chinese lunar, including leap months.
- Birth double-hour (时辰) — one of twelve two-hour blocks. The exact minute matters only for solar-time correction.
- Gender — used for the direction in which decadal spans progress.
- Birthplace — longitude, latitude and time zone, used for true solar time correction.
The app has a searchable city database, so you type a city name rather than coordinates. If you are unsure about the birthplace, leaving the default still produces a valid chart — the correction is usually small, but near a double-hour boundary it can shift the whole chart.
2. Convert the date
A solar date is converted to its Chinese lunar equivalent: lunar year, month, day and leap-month flag. The lunar year (not the Gregorian new year) supplies the heavenly stem that drives the birth Four Transformations. The lunar month and the double-hour supply the branch positions used to anchor the palaces.
3. Set the Five-Element Bureau and place Zi Wei
The stem and branch of the Self palace determine one of five bureaus — Water 2nd, Wood 3rd, Metal 4th, Earth 5th or Fire 6th. Together with the lunar day, the bureau fixes the position of Zi Wei, the lead star. From there the rest of the major stars are placed by fixed offset tables: the Zi Wei series (Zi Wei, Tian Ji, Tai Yang, Wu Qu, Tian Tong, Lian Zhen) and the Tian Fu series (Tian Fu, Tai Yin, Tan Lang, Ju Men, Tian Xiang, Tian Liang, Qi Sha, Po Jun).
4. Lay out the twelve palaces and their stems
Starting from the Self palace, the remaining eleven palaces follow a fixed order around the twelve earthly branches. Each branch also carries a heavenly stem, computed from the year stem. That palace stem is what later "flies" transformations out of a palace — it is not decorative, it is the engine of the reading.
Auxiliary stars (Wen Chang, Wen Qu, Zuo Fu, You Bi, Lu Cun, Tian Ma, the four challenging stars and many smaller ones) are placed by their own tables, and each major star gets a brightness grade — Bright, Prosperous, Favourable, Advantageous, Neutral, Weak or Fallen.
5. Compute the Four Transformations
The birth-year stem determines which four stars transform into Lu, Quan, Ke and Ji. The software uses the following table (the "Yang Wu Yin Tong" variant for the Geng stem):
| Year stem | Lu (禄) | Quan (权) | Ke (科) | Ji (忌) |
|---|---|---|---|---|
| 甲 Jia | Lian Zhen | Po Jun | Wu Qu | Tai Yang |
| 乙 Yi | Tian Ji | Tian Liang | Zi Wei | Tai Yin |
| 丙 Bing | Tian Tong | Tian Ji | Wen Chang | Lian Zhen |
| 丁 Ding | Tai Yin | Tian Tong | Tian Ji | Ju Men |
| 戊 Wu | Tan Lang | Tai Yin | You Bi | Tian Ji |
| 己 Ji | Wu Qu | Tan Lang | Tian Liang | Wen Qu |
| 庚 Geng | Tai Yang | Wu Qu | Tai Yin | Tian Tong |
| 辛 Xin | Ju Men | Tai Yang | Wen Qu | Wen Chang |
| 壬 Ren | Tian Liang | Zi Wei | Zuo Fu | Wu Qu |
| 癸 Gui | Po Jun | Ju Men | Tai Yin | Tan Lang |
Other schools use different assignments for a few stems. The app keeps those variants in its library rather than silently mixing them, so you always know which table produced a line.
6. Add decadal and finer layers
Decadal spans are derived from the bureau and the direction of travel. An annual layer takes the year's stem-branch and its palace; monthly, daily and hourly layers are located the same way. At each layer the palace stem flies its own four transformations, and the app checks which palaces they land in. The six-layer rule decides which layers are allowed to affect which others.
7. Why reproducibility is the point
No language model is involved. The same inputs always give the same chart, the same transformation arrows and the same reading — which means you can screenshot a result, come back a year later, and still be able to reconstruct exactly why it said what it said. That is the difference between a calculator and a fortune-telling chatbot.