Home › I Ching & Five Elements › Bagua Trigram Lookup (八卦)
Bagua Trigram Lookup (八卦)
Looks up one of the eight trigrams (八卦, bagua) and returns its lines, Fuxi (先天, xiantian) and Luoshu (洛书, later-heaven) numbers, directions in both arrangements, element, yin/yang, family member, body part, animal, attribute and season, plus a table of all eight.
When to use
You need the structured attributes of a trigram (乾 兑 离 震 巽 坎 艮 坤) or the whole eight-trigram table, e.g. to build or explain a hexagram, a compass arrangement or a feng shui reference.
Do not use when: You need a six-line hexagram (use hexagram-lookup), a person's Ming Gua trigram from a birth year (use ming-gua) or the Luoshu magic square (use luoshu-square).
Formula
lines bottom→top: 乾 111, 兑 110, 离 101, 震 100, 巽 011, 坎 010, 艮 001, 坤 000; Fuxi number = 8 − binary(lines) reading the bottom line as the most significant bit (乾 = 8 − 7 = 1); Luoshu number from the later-heaven arrangement (坎1 坤2 震3 巽4 乾6 兑7 艮8 离9)
Correspondences follow the 说卦传 (Shuogua) chapter of the Yijing and the standard Fuxi / King Wen arrangements. Traditional cultural reference calculation; not a prediction and not medical, legal or financial advice.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
trigram | string | yes | Chinese name (乾 兑 离 震 巽 坎 艮 坤, traditional 兌 離 accepted), pinyin (qian, dui, li, zhen, xun, kan, gen, kun), English nature (heaven, lake, fire, thunder, wind, water, mountain, earth), symbol (☰ … ☷), 3 line digits bottom→top with 1 = yang (e.g. 010 = 坎), or fuxi:N / luoshu:N number forms. |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
name_cn | string | Chinese name of the trigram. | |
pinyin | string | Hanyu pinyin of the name. | |
english | string | Natural image: Heaven, Lake, Fire, Thunder, Wind, Water, Mountain or Earth. | |
symbol | string | Unicode trigram symbol (U+2630–U+2637). | |
lines | string | Three digits from the bottom line to the top line; 1 = yang ⚊ (solid), 0 = yin ⚋ (broken). | |
line_description | string | The three lines in words from bottom to top. | |
fuxi_number | integer | Earlier-heaven number: 乾1 兑2 离3 震4 巽5 坎6 艮7 坤8. | |
luoshu_number | integer | Later-heaven / Luoshu number: 坎1 坤2 震3 巽4 乾6 兑7 艮8 离9 (5 is the centre). | |
later_heaven_direction | string | Compass direction in the King Wen / later-heaven arrangement used by feng shui. | |
earlier_heaven_direction | string | Compass direction in the Fuxi / earlier-heaven arrangement. | |
element | string | Five-element attribution: 乾 兑 Metal, 离 Fire, 震 巽 Wood, 坎 Water, 艮 坤 Earth. | |
yin_yang | string | 乾 震 坎 艮 are yang trigrams; 坤 巽 离 兑 are yin trigrams (by the family classification of the 说卦传). | |
family_member | string | Family role from the 说卦传 (Shuogua). | |
body_part | string | Body correspondence from the 说卦传. | |
animal | string | Animal correspondence from the 说卦传. | |
attribute | string | Characteristic quality (健 顺 动 入 陷 丽 止 说). | |
season | string | Season assigned in the later-heaven arrangement. | |
all_trigrams | list | One row per trigram (Fuxi order): name, pinyin, symbol, lines, Fuxi number, Luoshu number, later-heaven direction, element. |
Example
乾 Qian (Heaven): {"trigram":"乾"} → {"symbol":"☰","lines":"111","fuxi_number":1,"luoshu_number":6,"later_heaven_direction":"Northwest (NW, 西北)","element":"Metal (金)","family_member":"Father (父)"}
kan (Water) by pinyin: {"trigram":"kan"} → {"name_cn":"坎","symbol":"☵","lines":"010","fuxi_number":6,"luoshu_number":1,"later_heaven_direction":"North (N, 北)","element":"Water (水)","family_member":"Middle son (中男)"}
GET https://tttkmbb.com/api/v1/calculate/bagua?trigram=%E4%B9%BE
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/bagua(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/bagua · Markdown: https://tttkmbb.com/yijing/bagua.md · JSON definition: https://tttkmbb.com/yijing/bagua.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="bagua" - OpenAPI operationId:
lookup_bagua_trigram - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Bagua (reference)
- Wikipedia – I Ching (reference)
- Legge J. (1899) The Yî King, Sacred Books of the East vol. 16 (public domain) (textbook)
FAQ
Which line is the bottom line?
The first digit of `lines` is the bottom line (line 1) and the last digit is the top line, following the way trigrams are drawn from the ground up; 1 = solid yang line, 0 = broken yin line.
Why does 乾 have two different numbers?
The Fuxi (先天) sequence numbers the trigrams by their binary structure (乾 1 … 坤 8); the Luoshu (后天) numbers come from the King Wen compass arrangement mapped onto the Luoshu square (乾 6 in the northwest). Feng shui and Ming Gua use the Luoshu numbers.
Related calculators
- I Ching Hexagram Lookup (六十四卦) — Combine two trigrams into one of the 64 hexagrams.
- Luoshu Square (洛书) — The later-heaven numbers placed on the 3×3 Luoshu square.
- Ming Gua Calculator (命卦 / Eight Mansions) — Personal trigram (命卦) from birth year and sex.