# 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.

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

## Purpose

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.

**Use when:** 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).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `trigram` | string |  | required | 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. |

## Output

| Field | 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. |

## 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.

## Data Sources

- Wikipedia – Bagua — https://en.wikipedia.org/wiki/Bagua (reference, retrieved 2026-09-24)
- Wikipedia – I Ching — https://en.wikipedia.org/wiki/I_Ching (reference, retrieved 2026-09-24)
- Legge J. (1899) The Yî King, Sacred Books of the East vol. 16 (public domain) — https://sacred-texts.com/ich/index.htm (textbook, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/bagua?trigram=…`
- `POST https://tttkmbb.com/api/v1/calculate/bagua` 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/bagua · OpenAPI operationId `lookup_bagua_trigram` 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": "bagua", "inputs": {…}}`

## Example

- 乾 Qian (Heaven): inputs `{"trigram":"乾"}` → `{"symbol":"☰","lines":"111","fuxi_number":1,"luoshu_number":6,"later_heaven_direction":"Northwest (NW, 西北)","element":"Metal (金)","family_member":"Father (父)"}`
- kan (Water) by pinyin: inputs `{"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
```

## Limitations

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). 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. All values are computed from the formula above; no measurement or live data is involved.

## 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

- [I Ching Hexagram Lookup (六十四卦)](https://tttkmbb.com/yijing/hexagram-lookup.md) — Combine two trigrams into one of the 64 hexagrams.
- [Luoshu Square (洛书)](https://tttkmbb.com/yijing/luoshu-square.md) — The later-heaven numbers placed on the 3×3 Luoshu square.
- [Ming Gua Calculator (命卦 / Eight Mansions)](https://tttkmbb.com/yijing/ming-gua.md) — Personal trigram (命卦) from birth year and sex.
