# Stem and Branch Relations (干支合冲刑害)

> Finds the traditional relations among a set of heavenly stems (天干, tiangan) and earthly branches (地支, dizhi): stem combinations (五合, wuhe) and clashes (相冲, xiangchong), branch six-combinations (六合, liuhe), three-harmony frames (三合局, sanheju, incl. 半合 banhe), directional combinations (三会, sanhui), clashes (六冲, liuchong), harms (六害, liuhai), punishments (相刑 xiangxing, 自刑 zixing) and destructions (相破, xiangpo).

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

## Purpose

Finds the traditional relations among a set of heavenly stems (天干, tiangan) and earthly branches (地支, dizhi): stem combinations (五合, wuhe) and clashes (相冲, xiangchong), branch six-combinations (六合, liuhe), three-harmony frames (三合局, sanheju, incl. 半合 banhe), directional combinations (三会, sanhui), clashes (六冲, liuchong), harms (六害, liuhai), punishments (相刑 xiangxing, 自刑 zixing) and destructions (相破, xiangpo).

**Use when:** You have stems or branches from a Bazi chart, a date or a Liu Yao chart and need to list which of them combine, clash, harm or punish each other.

**Do not use when:** You need the abstract five-element relation between two elements (use five-elements) or the stems and branches of a date (use sexagenary-cycle or bazi-four-pillars).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `characters` | string_list |  | required | 2–8 stems or branches: Chinese characters (甲 … 癸, 子 … 亥; a pair such as 甲子 is split into both), pinyin (jia, zi …; wu is ambiguous, write 戊/午 or stem_wu/branch_wu) or zodiac animals (rat, ox …). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `items` | list |  | One row per character: character, pinyin, type (stem/branch), element, yin/yang and zodiac animal (branches). |
| `relations` | list |  | One row per relation: pair_or_group, kind, relation_cn, relation_en and result (element produced or the relation class). |
| `relation_count` | integer |  | How many relations were found. |
| `summary` | string |  | Short summary of the relations found. |

## Formula

`天干五合: 甲己→土, 乙庚→金, 丙辛→水, 丁壬→木, 戊癸→火; 天干相冲: 甲庚, 乙辛, 丙壬, 丁癸; 地支六合: 子丑→土, 寅亥→木, 卯戌→火, 辰酉→金, 巳申→水, 午未→土; 三合: 申子辰水, 亥卯未木, 寅午戌火, 巳酉丑金 (半合 = the peak branch with one other); 三会: 寅卯辰木, 巳午未火, 申酉戌金, 亥子丑水; 六冲: branches 6 apart; 六害: 子未 丑午 寅巳 卯辰 申亥 酉戌; 相刑: 寅巳申, 丑戌未, 子卯, 自刑 辰午酉亥; 相破: 子酉 丑辰 寅亥 卯午 巳申 未戌`

Tables follow the standard Ziping (子平) conventions used in Bazi and Liu Yao; 午未合 is reported as Earth. Only relations among the given characters are listed, each once. Traditional cultural reference calculation; not a prediction and not medical, legal or financial advice.

## Data Sources

- Wikipedia – Sexagenary cycle — https://en.wikipedia.org/wiki/Sexagenary_cycle (reference, retrieved 2026-09-24)
- Wikipedia – Wuxing (Chinese philosophy) — https://en.wikipedia.org/wiki/Wuxing_(Chinese_philosophy) (reference, 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/stem-branch-relations?characters=…`
- `POST https://tttkmbb.com/api/v1/calculate/stem-branch-relations` 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/stem-branch-relations · OpenAPI operationId `analyze_stem_branch_relations` 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": "stem-branch-relations", "inputs": {…}}`

## Example

- 甲 己 子 午: inputs `{"characters":["甲","己","子","午"]}` → `{"relation_count":2,"relations":[{"pair_or_group":"甲己","relation_cn":"天干五合（甲己合化土）","result":"Earth (土)"},{"pair_or_group":"子午","relation_cn":"六冲（子午相冲）","result":"clash (冲)"}]}`
- 申 子 辰 (three-harmony Water): inputs `{"characters":["申","子","辰"]}` → `{"relation_count":1,"relations":[{"pair_or_group":"申子辰","relation_cn":"三合水局（申子辰）","result":"Water (水)"}]}`

```
GET https://tttkmbb.com/api/v1/calculate/stem-branch-relations?characters=%E7%94%B2%2C%E5%B7%B1%2C%E5%AD%90%2C%E5%8D%88
```

## Limitations

You need the abstract five-element relation between two elements (use five-elements) or the stems and branches of a date (use sexagenary-cycle or bazi-four-pillars). Tables follow the standard Ziping (子平) conventions used in Bazi and Liu Yao; 午未合 is reported as Earth. Only relations among the given characters are listed, each once. 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

**What is a 半合 (half combination)?**

A three-harmony frame needs its three branches (e.g. 申子辰 for Water). When only the peak branch (子, 卯, 午 or 酉) and one of the two others are present, the pair is reported as a half combination of that frame.

**Why is the pinyin wu rejected?**

wu is the pinyin of both the stem 戊 and the branch 午; write the character, or stem_wu / branch_wu.

## Related

- [Five Elements Relation (五行生克)](https://tttkmbb.com/yijing/five-elements.md) — Generating and controlling relation of the resulting elements.
- [Sexagenary Cycle Calculator (干支)](https://tttkmbb.com/lunar/sexagenary-cycle.md) — Stem and branch of a year, month, day or hour.
- [Bazi Four Pillars (八字)](https://tttkmbb.com/lunar/bazi-four-pillars.md) — The four pillars whose characters are analysed here.
