METHOD & CHOICES · LIU YAO

Method & Choices

How we cast, and which conventions we take for the month and day authorities.

Rule by rule

Every Step, and Where It Comes From

Palace of the hexagram

Jing Fang's eight palaces. For the first through fifth generations the lines are flipped upward one at a time from the bottom; the wandering soul flips the fourth line back from the fifth generation; the returning soul then restores all three lines of the inner trigram.

Source: The common recension of Jing Fang's eight-palace order

Subject and object lines

The rank fixes the subject line: pure palace 6, first generation 1, second 2, third 3, fourth 4, fifth 5, wandering soul 4, returning soul 3. The object line always sits three positions away.

Source: The common recension of Jing Fang's eight-palace order

Na-jia attachment

By the Na-jia song 《纳甲歌》: Qian metal takes jia-zi within and ren-wu without; Kan water wu-yin / wu-shen; Gen earth bing-chen / bing-xu; Zhen wood geng-zi / geng-wu; Xun wood xin-chou / xin-wei; Li fire ji-mao / ji-you; Kun earth yi-wei / gui-chou; Dui metal ding-si / ding-hai.

Source: The common recensions of Bushi Zhengzong 《卜筮正宗》 and Zengshan Buyi 《增删卜易》

The six relatives

The palace's element is taken as self: what matches self is siblings, what generates self is parents, what self generates is offspring, what self controls is wealth, what controls self is officials.

Source: The common recensions of Bushi Zhengzong 《卜筮正宗》 and Zengshan Buyi 《增删卜易》

The six spirits

Started from the day stem: jia and yi start at the Azure Dragon, bing and ding at the Vermilion Bird, wu at the Hook Snake, ji at the Serpent, geng and xin at the White Tiger, ren and gui at the Dark Warrior. The order runs Dragon, Bird, Hook Snake, Serpent, White Tiger, Dark Warrior, upward from the bottom line.

Source: The common recensions of Bushi Zhengzong 《卜筮正宗》 and Zengshan Buyi 《增删卜易》

Void in the decade

The two empty branches of the decade that the day pillar falls in.

Source: The common recensions of Bushi Zhengzong 《卜筮正宗》 and Zengshan Buyi 《增删卜易》

Month command and month break

The month command is the earthly branch of the solar-term month pillar; the month break is the branch it clashes with.

Source: The common recensions of Bushi Zhengzong 《卜筮正宗》 and Zengshan Buyi 《增删卜易》

Hidden line and covering line

When the primary hexagram does not hold all the relatives, the missing one is taken from the same position in the palace's own pure hexagram as the hidden line; the line at that same position in the primary hexagram is the covering line.

Source: The common recensions of Bushi Zhengzong 《卜筮正宗》 and Zengshan Buyi 《增删卜易》

The resulting hexagram

Old yang (9) turns to yin and old yin (6) turns to yang; young yang (7) and young yin (8) do not move.

Source: The common recensions of Bushi Zhengzong 《卜筮正宗》 and Zengshan Buyi 《增删卜易》

Casting with coins

Three coins, six tosses. Zero yang faces gives old yin 6, one gives young yang 7, two gives young yin 8, three gives old yang 9.

Source: The common coin-toss method

Calendar

Always tyme4ts, the single calendar source in this codebase. No second implementation is brought in.

Source: This site's decision

Deliberate choices

Three Things Done on Purpose

We write 螣蛇, not 腾蛇

Both spellings are in use. We take 螣蛇, the form used in the Bushi Zhengzong 《卜筮正宗》 line, and pin it into the type definition — a misspelled literal will not compile, so the rule enforces itself instead of relying on memory.

The palaces are derived, not copied

We do not hard-code a table of sixty-four hexagrams and their palaces; we generate them from the construction rule and assert that exactly sixty-four come out, with no duplicates. A hand-copied table of sixty-four rows hides a single miscopied cell forever; a wrong derivation breaks a whole palace at once and is visible immediately. The classical order table is kept separately, purely as a second source to check against.

The clash and union hexagrams are not copied either

They are computed from the definition: pair the inner and outer trigram lines (1-4, 2-5, 3-6) and check their branches — all three clashing makes a six-clash hexagram, all three uniting makes a six-union one. What comes out is exactly the customary ten six-clash hexagrams (the eight pure hexagrams plus 天雷无妄 and 雷天大壮) and the eight six-union hexagrams (泰, 否, 豫, 复, 困, 节, 贲, 旅).

Where the schools disagree

Three Disputed Points, and What We Do

The real danger is not a wrong calculation; it is quietly picking a side where the schools disagree and not saying so. Each of these three is handled differently, and each is stated here.

①
Whose palace decides a resulting line's relative?
Both traditions printed; we do not decide

Mainstream software takes the palace of the resulting hexagram itself; another tradition holds that a resulting line never leaves the original palace and takes the primary hexagram's palace instead. We print both — the two columns labelled by the resulting hexagram's palace and by the primary's — and we do not decide between them for you. Four cases in the test library were picked precisely because the two traditions disagree on them, pinning the difference into the tests.

②
Does the day turn at 23:00 or at midnight?
A switch, defaulting to our Bazi side (23:00)

By default the day turns at 23:00, matching our Bazi side. This is not a rounding difference: for the same moment (2026-03-10 23:30) and the same hexagram, flipping only this switch changes the day pillar from jia-shen to gui-wei, the voids from wu-wei to shen-you, and the spirit on the bottom line from the Azure Dragon to the Dark Warrior — three things at once. The test library keeps exactly such a pair of same-moment, same-hexagram charts, so that the disagreement is shown rather than buried in a default.

③
Is xu to chou an advance or a retreat?
We do not judge it, and we say so

The seven advancing pairs (hai to zi, yin to mao, si to wu, shen to you, chou to chen, chen to wei, wei to xu) and their seven reversals are judged as usual. But xu turning to chou, which closes the four-earth cycle, is written up inconsistently — some call it an advance, some a retreat — so we deliberately leave it out and return no judgement at all. Better to withhold a verdict than to put words in the classics' mouth.

The rules, in one paragraph

Our rules, stated so that a disagreement can be located: the eight-palace order is derived from Jing Fang's construction (flip the lines upward for the first through fifth generations, flip the fourth back for the wandering soul, restore the inner trigram for the returning soul); attachment follows the Na-jia song; the six relatives take the palace's element as self; the six spirits start from the day stem; the month command is the earthly branch of the solar-term month pillar, and the month break is what it clashes with; voids follow the day pillar's decade; hidden lines are taken from the palace's pure hexagram at the same position; the day changes at 23:00. For the resulting lines we print both traditions of the six relatives — by the resulting hexagram's palace and by the primary's — and we do not decide between them for you.

起课第一步可选

口 径 之 辨

六爻起卦纳甲、世应与六神排布,各家向来逐爻一致,并无分歧。流传至今的歧见,主要落在变爻六亲归于何宫,以及子夜交接之时何处换日。变爻六亲关乎生克向背,换日时刻关乎日柱干支。本站排盘将这几处分歧交由起卦人在首步自行选取,缺省取按本卦宫定变爻六亲与子初换日,使盘面条理井然、理路分明。

变爻六亲何属

动爻变出新爻之后,变爻的六亲该以何者为参照来定,历来有两派主张。一派认为变爻仍为本卦之变,当以本卦所属之宫为纲;另一派则视变爻归入变卦,当以变卦自属之宫为本。此论一变,六亲名目与向背生克随之更替。

按本卦宫 变爻的五行与本卦所属之宫五行相比来定六亲。此法是《增删卜易》与《卜筮正宗》一系的通行写法,外部排盘中的元亨利贞、易安居两家都这样排。其理在于动爻虽变,根基仍在本卦之宫,变爻专司生克本爻,故六亲遵从本宫。

按变卦宫 以变卦自己所属之宫的五行为准,将变爻五行与变卦宫相比来定六亲,另有一派专门这样取法。此派认为爻既已发动变化成变卦,其所属统辖之气已归于变卦本宫,自当以变卦宫之五行论定变爻之六亲名位。

同一个变爻,两法排出的六亲可能全然不同,例如按本卦宫论为妻财,按变卦宫论则化为官鬼。卦上变爻六亲一旦更迭,断卦时回头生克、化进化退的判读便完全不同;若无动爻则两法无异。

子夜何时换日

起卦定日辰干支,在子夜交割之际究竟从何时起算次日,历来存在分水岭。一派主张以子初二十三点为新一日之始,另一派则坚持以夜半零点子正为界。一日干支早换或晚换一个钟头,两派各守规矩,在术数中皆为通行之法。

子初换日 自夜间二十三点起算新的一天,日柱干支随之换入次日。此派认为地支子时发端于二十三点,一日之始不可支干割裂,故入子时即入次日。此法在术数中流传极广,两派皆通,八字排盘亦常同用子初换日。

子正换日 以夜半零点为换日之界,至零点整方才起算新的一天。在二十三点至零点的这一个钟头之内,时刻虽已交入子时,但日柱仍取前一日干支,须待交过零点才正式更替日柱,同样在术数流派中广为遵行。

两法仅对夜间二十三点至零点这一个钟头内所起之课产生影响。在此一时段内日柱干支相差一日,盘中日柱随之更迭;其余二十三个钟头内起课,两法日柱完全一致,盘面毫无分别。

What Is Liu Yao → · ← Liu Yao · ← Compendium