{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"luoshu-square"},"result":{"entity_type":"calculator","id":"luoshu-square","calculator_id":"luoshu-square","canonical_url":"https://tttkmbb.com/yijing/luoshu-square","name":"Luoshu Square (洛书)","title":"Luoshu Square – The 3×3 Magic Square (洛书), Nine Palaces, Colours, Trigrams and Directions","category":"yijing","category_name":"I Ching & Five Elements","tool_name":"describe_luoshu_square","featured_mcp_tool":false,"description":"Describes a palace of the Luoshu magic square (洛书, Lo Shu): its colour name (一白 … 九紫), later-heaven trigram, direction, element, season and family member, together with the full grid, the magic constant 15, the Hetu (河图) partner number and the opposite palace.","use_when":"You need the meaning of a Luoshu / Flying Star number 1–9, the palace grid, or which trigram and direction a number stands for.","do_not_use_when":"You need a personal Kua number (use ming-gua) or the annual/monthly flying stars of a period (use nine-star-feng-shui).","inputs":[{"name":"number","label":"Palace number","type":"integer","required":false,"default":5,"min":1,"max":9,"description":"Luoshu number 1–9 (5 = centre).","example":1}],"outputs":[{"name":"number","label":"Number","type":"integer","decimals":0,"description":"The palace number."},{"name":"color_name","label":"Colour name (紫白)","type":"string","decimals":4,"description":"Nine-star colour name: 一白 二黑 三碧 四绿 五黄 六白 七赤 八白 九紫."},{"name":"trigram","label":"Trigram (后天)","type":"string","decimals":4,"description":"Later-heaven trigram of the palace (none for the centre)."},{"name":"direction","label":"Direction","type":"string","decimals":4,"description":"Compass direction of the palace."},{"name":"element","label":"Element","type":"string","decimals":4,"description":"Five-element attribution (1 Water, 2/5/8 Earth, 3/4 Wood, 6/7 Metal, 9 Fire)."},{"name":"season","label":"Season","type":"string","decimals":4,"description":"Season of the palace's trigram."},{"name":"family_member","label":"Family member","type":"string","decimals":4,"description":"Family role of the palace's trigram."},{"name":"grid","label":"Grid (south at top)","type":"string_list","decimals":4,"description":"The square as three rows in the traditional orientation with south (9) at the top: 4 9 2 / 3 5 7 / 8 1 6."},{"name":"magic_constant","label":"Magic constant","type":"integer","decimals":0,"description":"Sum of every row, column and diagonal."},{"name":"hetu_pair","label":"Hetu partner (河图)","type":"integer","decimals":0,"description":"Partner number in the River Map pairs 1–6 水, 2–7 火, 3–8 木, 4–9 金, 5–10 土."},{"name":"hetu_element","label":"Hetu element","type":"string","decimals":4,"description":"Element of the Hetu pair."},{"name":"opposite_palace","label":"Opposite palace","type":"integer","decimals":0,"description":"Palace across the centre; the two numbers sum to 10 (the centre is its own opposite)."},{"name":"all_palaces","label":"All nine palaces","type":"list","decimals":4,"description":"One row per number: colour name, trigram, direction, element."}],"input_schema":{"type":"object","properties":{"number":{"description":"Luoshu number 1–9 (5 = centre).","type":"integer","minimum":1,"maximum":9,"default":5,"examples":[1]}},"additionalProperties":false},"output_schema":{"type":"object","properties":{"number":{"description":"The palace number.","type":"integer"},"color_name":{"description":"Nine-star colour name: 一白 二黑 三碧 四绿 五黄 六白 七赤 八白 九紫.","type":"string"},"trigram":{"description":"Later-heaven trigram of the palace (none for the centre).","type":"string"},"direction":{"description":"Compass direction of the palace.","type":"string"},"element":{"description":"Five-element attribution (1 Water, 2/5/8 Earth, 3/4 Wood, 6/7 Metal, 9 Fire).","type":"string"},"season":{"description":"Season of the palace's trigram.","type":"string"},"family_member":{"description":"Family role of the palace's trigram.","type":"string"},"grid":{"description":"The square as three rows in the traditional orientation with south (9) at the top: 4 9 2 / 3 5 7 / 8 1 6.","type":"array","items":{"type":"string"}},"magic_constant":{"description":"Sum of every row, column and diagonal.","type":"integer"},"hetu_pair":{"description":"Partner number in the River Map pairs 1–6 水, 2–7 火, 3–8 木, 4–9 金, 5–10 土.","type":"integer"},"hetu_element":{"description":"Element of the Hetu pair.","type":"string"},"opposite_palace":{"description":"Palace across the centre; the two numbers sum to 10 (the centre is its own opposite).","type":"integer"},"all_palaces":{"description":"One row per number: colour name, trigram, direction, element.","type":"array"}}},"formula":"grid = [4 9 2; 3 5 7; 8 1 6], magic constant = 3·(1+…+9)/9 = 15; opposite = 10 − number (5 → 5); Hetu partner = number ± 5","method":"Later-heaven mapping 坎1 N, 坤2 SW, 震3 E, 巽4 SE, 5 centre, 乾6 NW, 兑7 W, 艮8 NE, 离9 S; colours from the 紫白 (purple-white) flying-star tradition. Traditional cultural reference calculation; not a prediction and not medical, legal or financial advice.","sources":[{"name":"Wikipedia – Lo Shu Square","url":"https://en.wikipedia.org/wiki/Lo_Shu_Square","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – Bagua","url":"https://en.wikipedia.org/wiki/Bagua","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"Palace 1","inputs":{"number":1},"expected":{"color_name":"1 一白 (Yi Bai, White)","trigram":"坎 Kan ☵ (Water)","direction":"North (N, 北)","element":"Water (水)","magic_constant":15,"hetu_pair":6,"opposite_palace":9},"url":"https://tttkmbb.com/api/v1/calculate/luoshu-square?number=1"},{"name":"Palace 5 (centre)","inputs":{"number":5},"expected":{"color_name":"5 五黄 (Wu Huang, Yellow)","direction":"Centre (中)","element":"Earth (土)","hetu_pair":10,"opposite_palace":5,"grid":["4 9 2","3 5 7","8 1 6"]},"url":"https://tttkmbb.com/api/v1/calculate/luoshu-square?number=5"}],"faq":[{"q":"Why is 9 at the top of the grid?","a":"Chinese diagrams put south at the top; 9 (离, south) is therefore the top-centre cell and 1 (坎, north) the bottom-centre cell. Rotating the grid does not change the sums."},{"q":"What is the Hetu partner?","a":"The River Map (河图) pairs 1–6, 2–7, 3–8, 4–9 and 5–10 as the generating and completing numbers of Water, Fire, Wood, Metal and Earth; 10 is not a Luoshu palace."}],"tags":["luoshu","lo shu square","洛书","magic square","nine palaces","flying star numbers"],"related":[{"calculator_id":"bagua","reason":"Full attributes of the palace's trigram."},{"calculator_id":"ming-gua","reason":"Personal Kua number defined by these palaces."},{"calculator_id":"five-elements","reason":"Relations between the elements of two palaces."}],"links":{"html":"https://tttkmbb.com/yijing/luoshu-square","markdown":"https://tttkmbb.com/yijing/luoshu-square.md","json":"https://tttkmbb.com/yijing/luoshu-square.json","api":"https://tttkmbb.com/api/v1/calculate/luoshu-square","schema":"https://tttkmbb.com/api/v1/calculators/luoshu-square","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T08:31:35Z","next_actions":[{"tool":"run_calculator","calculator_id":"luoshu-square","reason":"Run Luoshu Square (洛书) with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/yijing/luoshu-square.md"}}