# Liu Yao Hexagram Chart (六爻)

> Builds the full Liu Yao (six-lines coin oracle) chart for six cast lines: original and changed hexagrams, the 京房 palace with 世/应 lines, the 纳甲 stem-branch of every line, six relatives (六亲) against the palace element, six beasts (六神) from the day stem, void branches (旬空), day and month relations and hidden lines (伏神).

- Calculator id: `liuyao` · Category: I Ching & Five Elements (`yijing`) · Tool name: `chart_liuyao_hexagram`
- Canonical page: https://tttkmbb.com/yijing/liuyao · This document: https://tttkmbb.com/yijing/liuyao.md · JSON definition: https://tttkmbb.com/yijing/liuyao.json

## Purpose

Builds the full Liu Yao (six-lines coin oracle) chart for six cast lines: original and changed hexagrams, the 京房 palace with 世/应 lines, the 纳甲 stem-branch of every line, six relatives (六亲) against the palace element, six beasts (六神) from the day stem, void branches (旬空), day and month relations and hidden lines (伏神).

**Use when:** You have six lines cast with three coins (or as 0/1 digits with moving positions) and need the traditional 六爻 chart for a given day, including 纳甲, 六亲, 六神, 世应, 旬空, 月破 and 伏神.

**Do not use when:** You want to cast a hexagram from a time or numbers (use meihua-yishu), or only need the structural change of lines without the calendar layer (use hexagram-change).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `lines` | string |  | required | Six digits from the bottom line up: 6 = 老阴 (moving yin), 7 = 少阳, 8 = 少阴, 9 = 老阳 (moving yang). Six 0/1 digits (1 = yang) are also accepted together with moving_lines. |
| `moving_lines` | string |  | optional | Optional comma-separated positions 1–6 of moving lines (needed with 0/1 input, added to any 6/9 lines), e.g. "1,4". |
| `date` | date |  | optional, default "today" | Civil date of the cast in China Standard Time (UTC+8), 1900–2100; sets the day and month pillars. |
| `time` | string |  | optional | Optional clock time HH:MM for the hour pillar. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `original_hexagram` | string |  | King Wen number, full Chinese name, symbol, pinyin and Wilhelm title. |
| `original_lines` | string |  | Six digits bottom→top, 1 = yang, 0 = yin. |
| `changed_hexagram` | string |  | Hexagram after all moving lines change, or "none" when no line moves. |
| `palace` | string |  | 京房 palace and the hexagram's position in it (本宫, 一世 … 五世, 游魂, 归魂). |
| `palace_element` | string |  | Five-element of the palace, the reference for the six relatives. |
| `shi_line` | integer |  | Position of the 世 (self) line, 1 = bottom. |
| `ying_line` | integer |  | Position of the 应 (other) line, three lines from 世. |
| `day_ganzhi` | string |  | Sexagenary day of the cast. |
| `month_ganzhi` | string |  | Sexagenary month by solar terms (节). |
| `hour_ganzhi` | string |  | Sexagenary hour when a time is given (五鼠遁 from the day stem). |
| `void_branches` | string |  | The two branches missing from the day's ten-day 旬. |
| `lines_table` | list |  | One row per line bottom→top: position, line_type, najia (纳甲), element, six_relative (六亲), six_beast (六神), is_shi, is_ying, moving, changed_najia and changed_six_relative (moving lines only), void (旬空), day_relation (同/冲/合 with the day branch) and month_relation (旺相休囚死 vs the month branch, plus 月破). |
| `fu_shen` | string_list |  | For each of the five relatives absent from the hexagram: the line of the palace's pure hexagram (本宫卦) that carries it, with its 纳甲, position and the covering line (飞神). |
| `disclaimer` | string |  | Cultural framing of the result. |

## Formula

`Line value 7/9 = yang, 6/8 = yin; 6 and 9 move (变爻) and flip in the changed hexagram. Palace: pure hexagram, then lines 1–5 flipped in turn (一世 … 五世, 世 = the flipped line), line 4 flipped back (游魂, 世 4) and the inner trigram restored (归魂, 世 3); 本宫 世 = 6; 应 = 世 ± 3. 纳甲: 乾 甲子·寅·辰 / 壬午·申·戌, 坎 戊寅·辰·午 / 申·戌·子, 艮 丙辰·午·申 / 戌·子·寅, 震 庚子·寅·辰 / 午·申·戌, 巽 辛丑·亥·酉 / 未·巳·卯, 离 己卯·丑·亥 / 酉·未·巳, 坤 乙未·巳·卯 / 癸丑·亥·酉, 兑 丁巳·卯·丑 / 亥·酉·未. 六亲 = branch element vs palace element (same 兄弟, generates 父母, generated 子孙, controls 官鬼, controlled 妻财). 六神 start by day stem (甲乙 青龙, 丙丁 朱雀, 戊 勾陈, 己 螣蛇, 庚辛 白虎, 壬癸 玄武) in the order 青龙 朱雀 勾陈 螣蛇 白虎 玄武 from line 1. 旬空 = the two branches after the ten days of the day's 旬.`

Rules follow the 京房 palace system and the Qing textbook 增删卜易; the day, month (solar-term based) and hour pillars come from the shared calendar core in China Standard Time. Changed-line relatives are judged against the original palace; 三刑, 三合 and 六害 are not evaluated. Traditional reference calculation from the Chinese divination and numerology literature: it reports what the tradition assigns to the cast or number, not a prediction and not medical, legal or financial advice.

## Data Sources

- Wikipedia (zh) – 六爻 (Liu Yao) — https://zh.wikipedia.org/wiki/六爻 (reference, retrieved 2026-09-24)
- Wikipedia (zh) – 納甲 (stems and branches of the trigram lines) — https://zh.wikipedia.org/wiki/納甲 (reference, retrieved 2026-09-24)
- 野鹤老人, 增删卜易 – Qing-dynasty Liu Yao textbook (public domain); 世应, 六亲, 六神 and 旬空 rules as summarized on Wikipedia (zh) 六爻 — https://zh.wikipedia.org/wiki/六爻 (textbook, retrieved 2026-09-24)

Data freshness: `daily` (max_age_seconds 86400). Depends on the current date.

## API

- `GET https://tttkmbb.com/api/v1/calculate/liuyao?lines=…`
- `POST https://tttkmbb.com/api/v1/calculate/liuyao` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/liuyao · OpenAPI operationId `chart_liuyao_hexagram` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "liuyao", "inputs": {…}}`

## Example

- Six unchanging yang lines (777777) on 2026-09-24: inputs `{"lines":"777777","date":"2026-09-24"}` → `{"original_hexagram":"1 乾为天 ䷀ (Qian, The Creative)","changed_hexagram":"none","palace":"乾宫 (Qian palace), 本宫卦","palace_element":"金 Metal","shi_line":6,"ying_line":3,"day_ganzhi":"辛丑 (Xinchou)","month_ganzhi":"丁酉 (Dingyou)","void_branches":"辰巳 (Chen, Si)","lines_table":[{"najia":"甲子 (Jiazi)","six_relative":"子孙 Children","six_beast":"白虎 White Tiger","void":false,"day_relation":"合 (combines with day branch 丑)"},{"najia":"甲寅 (Jiayin)","six_relative":"妻财 Wife-Wealth","six_beast":"玄武 Black Tortoise","month_relation":"死 (Si, dead)"},{"najia":"甲辰 (Jiachen)","six_relative":"父母 Parents","six_beast":"青龙 Azure Dragon","void":true},{"najia":"壬午 (Renwu)","six_relative":"官鬼 Officials-Ghosts","six_beast":"朱雀 Vermilion Bird"},{"najia":"壬申 (Renshen)","six_relative":"兄弟 Siblings","six_beast":"勾陈 Hook Array","month_relation":"旺 (Wang, prosperous)"},{"najia":"壬戌 (Renxu)","six_relative":"父母 Parents","six_beast":"螣蛇 Flying Serpent","is_shi":true}]}`
- 797878 (line 2 moving) on 2025-01-01: inputs `{"lines":"797878","date":"2025-01-01","time":"10:30"}` → `{"original_hexagram":"5 水天需 ䷄ (Xu, Waiting)","changed_hexagram":"63 水火既济 ䷾ (Ji Ji, After Completion)","palace":"坤宫 (Kun palace), 游魂卦","palace_element":"土 Earth","shi_line":4,"ying_line":1,"day_ganzhi":"庚午 (Gengwu)","month_ganzhi":"丙子 (Bingzi)","hour_ganzhi":"辛巳 (Xinsi)","void_branches":"戌亥 (Xu, Hai)","lines_table":[{"najia":"甲子 (Jiazi)","six_relative":"妻财 Wife-Wealth","six_beast":"白虎 White Tiger","day_relation":"冲 (clashes with day branch 午)"},{"najia":"甲寅 (Jiayin)","six_relative":"官鬼 Officials-Ghosts","moving":true,"changed_najia":"己丑 (Jichou)","changed_six_relative":"兄弟 Siblings"},{"najia":"甲辰 (Jiachen)","six_relative":"兄弟 Siblings"},{"najia":"戊申 (Wushen)","six_relative":"子孙 Children","is_shi":true},{"najia":"戊戌 (Wuxu)","six_relative":"兄弟 Siblings","void":true},{"najia":"戊子 (Wuzi)","six_relative":"妻财 Wife-Wealth","month_relation":"旺 (Wang, prosperous)"}],"fu_shen":["父母 Parents: 伏神 乙巳 (Yisi, 火 Fire) at line 2 of 本宫卦 坤为地, under 飞神 甲寅 官鬼 Officials-Ghosts"]}`

```
GET https://tttkmbb.com/api/v1/calculate/liuyao?lines=777777&date=2026-09-24
```

## Limitations

You want to cast a hexagram from a time or numbers (use meihua-yishu), or only need the structural change of lines without the calendar layer (use hexagram-change). Rules follow the 京房 palace system and the Qing textbook 增删卜易; the day, month (solar-term based) and hour pillars come from the shared calendar core in China Standard Time. Changed-line relatives are judged against the original palace; 三刑, 三合 and 六害 are not evaluated. Traditional reference calculation from the Chinese divination and numerology literature: it reports what the tradition assigns to the cast or number, not a prediction and not medical, legal or financial advice. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I enter coin throws?**

For each throw from the bottom line up, add the coin values (heads 3, tails 2): 6 = old yin (moving), 7 = young yang, 8 = young yin, 9 = old yang (moving). Enter the six digits bottom first, e.g. 797878.

**Which month is the 月建?**

The solar-term month (寅 from 立春, 卯 from 惊蛰 …), not the lunar month, because Liu Yao judges strength by the 节气 calendar. 月破 marks a line whose branch clashes with the month branch.

**What is a 伏神?**

When one of the five relatives is absent from the six lines, it is 'hidden' under the line at the same position of the palace's pure hexagram; the covering line is the 飞神. The chart lists every absent relative with its hidden 纳甲.

## Related

- [Plum Blossom Numerology (梅花易数)](https://tttkmbb.com/yijing/meihua-yishu.md) — Cast a hexagram from a time or numbers instead of coins.
- [Hexagram Change Calculator (变卦)](https://tttkmbb.com/yijing/hexagram-change.md) — Structural analysis of the changed hexagram without the calendar layer.
- [Sexagenary Cycle Calculator (干支)](https://tttkmbb.com/lunar/sexagenary-cycle.md) — Day and month pillars used for 六神, 旬空 and 月建.
