{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"ming-gua"},"result":{"entity_type":"calculator","id":"ming-gua","calculator_id":"ming-gua","canonical_url":"https://tttkmbb.com/yijing/ming-gua","name":"Ming Gua Calculator (命卦 / Eight Mansions)","title":"Ming Gua Calculator – Personal Kua Number, East/West Group and Eight Mansions (八宅) Directions","category":"yijing","category_name":"I Ching & Five Elements","tool_name":"calculate_ming_gua","featured_mcp_tool":false,"description":"Computes the personal trigram (命卦, minggua) and Kua number from the birth year and sex by the Luoshu year-star method, assigns the East Four / West Four group (东四命 dongsiming / 西四命 xisiming) and lists the four favourable and four unfavourable directions of the Eight Mansions (八宅, bazhai) school.","use_when":"You need someone's Kua number, Ming Gua trigram or Eight Mansions directions from a birth date, with the year boundary at 立春 (default) or Chinese New Year.","do_not_use_when":"You need the annual Flying Star of a year (use nine-star-feng-shui), the zodiac animal (use chinese-zodiac) or a full Bazi chart (use bazi-four-pillars).","inputs":[{"name":"birth_date","label":"Birth date","type":"date","required":true,"description":"Gregorian birth date (civil date in China Standard Time), 1900–2100.","example":"1990-06-01"},{"name":"sex","label":"Sex","type":"enum","required":true,"values":[{"value":"male","label":"Male","aliases":["m","man","男"]},{"value":"female","label":"Female","aliases":["f","woman","女"]}],"description":"Sex used by the traditional formula (male and female formulas differ).","example":"male"},{"name":"boundary","label":"Year boundary","type":"enum","required":false,"default":"lichun","values":[{"value":"lichun","label":"立春 (Start of Spring, solar year)","aliases":["solar","start_of_spring"]},{"value":"lunar_new_year","label":"Chinese New Year (lunar year)","aliases":["lunar","chinese_new_year"]}],"description":"Where the Chinese year changes for birthdays in January–February: 立春 (about 4 February, the feng shui convention) or Chinese New Year.","example":"lichun"}],"outputs":[{"name":"gua","label":"Ming Gua (命卦)","type":"string","decimals":4,"description":"Personal trigram with pinyin, symbol and nature."},{"name":"gua_number","label":"Kua number","type":"integer","decimals":0,"description":"Luoshu number of the trigram: 1 坎, 2 坤, 3 震, 4 巽, 6 乾, 7 兑, 8 艮, 9 离 (5 is replaced by 2 for men and 8 for women)."},{"name":"group","label":"Group","type":"string","decimals":4,"description":"East Four (东四命: 坎 离 震 巽) or West Four (西四命: 乾 坤 艮 兑)."},{"name":"element","label":"Element","type":"string","decimals":4,"description":"Five-element attribution of the trigram."},{"name":"favorable_directions","label":"Favourable directions (四吉方)","type":"object","decimals":4,"description":"sheng_qi (生气), tian_yi (天医), yan_nian (延年), fu_wei (伏位) → compass direction."},{"name":"unfavorable_directions","label":"Unfavourable directions (四凶方)","type":"object","decimals":4,"description":"jue_ming (绝命), wu_gui (五鬼), liu_sha (六煞), huo_hai (祸害) → compass direction."},{"name":"stars_legend","label":"Stars legend","type":"string","decimals":4,"description":"Meaning of the eight wandering stars (八游星)."},{"name":"year_used","label":"Year used","type":"integer","decimals":0,"description":"Chinese year the birth date falls in under the chosen boundary."},{"name":"year_star","label":"Year star (年紫白)","type":"string","decimals":4,"description":"Luoshu star of the birth year (1864 = 一白, descending one per year)."},{"name":"disclaimer","label":"Disclaimer","type":"string","decimals":4,"description":"Cultural-reference statement."}],"input_schema":{"type":"object","properties":{"birth_date":{"description":"Gregorian birth date (civil date in China Standard Time), 1900–2100.","type":"string","format":"date","examples":["1990-06-01"]},"sex":{"description":"Sex used by the traditional formula (male and female formulas differ).","type":"string","enum":["male","female"],"examples":["male"]},"boundary":{"description":"Where the Chinese year changes for birthdays in January–February: 立春 (about 4 February, the feng shui convention) or Chinese New Year.","type":"string","enum":["lichun","lunar_new_year"],"default":"lichun","examples":["lichun"]}},"additionalProperties":false,"required":["birth_date","sex"]},"output_schema":{"type":"object","properties":{"gua":{"description":"Personal trigram with pinyin, symbol and nature.","type":"string"},"gua_number":{"description":"Luoshu number of the trigram: 1 坎, 2 坤, 3 震, 4 巽, 6 乾, 7 兑, 8 艮, 9 离 (5 is replaced by 2 for men and 8 for women).","type":"integer"},"group":{"description":"East Four (东四命: 坎 离 震 巽) or West Four (西四命: 乾 坤 艮 兑).","type":"string"},"element":{"description":"Five-element attribution of the trigram.","type":"string"},"favorable_directions":{"description":"sheng_qi (生气), tian_yi (天医), yan_nian (延年), fu_wei (伏位) → compass direction.","type":"object"},"unfavorable_directions":{"description":"jue_ming (绝命), wu_gui (五鬼), liu_sha (六煞), huo_hai (祸害) → compass direction.","type":"object"},"stars_legend":{"description":"Meaning of the eight wandering stars (八游星).","type":"string"},"year_used":{"description":"Chinese year the birth date falls in under the chosen boundary.","type":"integer"},"year_star":{"description":"Luoshu star of the birth year (1864 = 一白, descending one per year).","type":"string"},"disclaimer":{"description":"Cultural-reference statement.","type":"string"}}},"formula":"year_star k = 1 − ((year − 1864) mod 9), wrapped into 1–9; male gua = k (5 → 2 坤); female gua = 15 − k reduced into 1–9 (5 → 8 艮); trigram by Luoshu number; directions from the Eight Mansions table","method":"Equivalent to the popular rules male = (10 − yy) mod 9 for 19xx / (9 − yy) mod 9 for 20xx and female = (yy + 5) mod 9 / (yy + 6) mod 9 with 0 read as 9. The year changes at 立春 by default. Traditional cultural reference calculation; not a prediction and not medical, legal or financial advice.","sources":[{"name":"Wikipedia – Feng shui (Eight Mansions, 八宅)","url":"https://en.wikipedia.org/wiki/Feng_shui","type":"reference","retrieved_at":"2026-09-24"},{"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":"Female born 1990-06-01","inputs":{"birth_date":"1990-06-01","sex":"female"},"expected":{"gua":"艮 Gen ☶ (Mountain)","gua_number":8,"group":"West Four (西四命)","element":"Earth (土)","favorable_directions":{"sheng_qi":"Southwest (SW, 西南)","tian_yi":"Northwest (NW, 西北)","yan_nian":"West (W, 西)","fu_wei":"Northeast (NE, 东北)"},"unfavorable_directions":{"jue_ming":"Southeast (SE, 东南)","wu_gui":"North (N, 北)","liu_sha":"East (E, 东)","huo_hai":"South (S, 南)"},"year_used":1990,"year_star":"1 一白 (Yi Bai, White)"},"url":"https://tttkmbb.com/api/v1/calculate/ming-gua?birth_date=1990-06-01&sex=female"},{"name":"Male born 2000-06-01","inputs":{"birth_date":"2000-06-01","sex":"male"},"expected":{"gua":"离 Li ☲ (Fire)","gua_number":9,"group":"East Four (东四命)","favorable_directions":{"sheng_qi":"East (E, 东)","tian_yi":"Southeast (SE, 东南)","yan_nian":"North (N, 北)","fu_wei":"South (S, 南)"},"unfavorable_directions":{"jue_ming":"Northwest (NW, 西北)","wu_gui":"West (W, 西)","liu_sha":"Southwest (SW, 西南)","huo_hai":"Northeast (NE, 东北)"},"year_star":"9 九紫 (Jiu Zi, Purple)"},"url":"https://tttkmbb.com/api/v1/calculate/ming-gua?birth_date=2000-06-01&sex=male"}],"faq":[{"q":"Which year applies to a January or early-February birthday?","a":"Feng shui schools use the solar year starting at 立春 (about 4 February); someone born on 1990-01-20 is therefore counted in 1989. Choose boundary = lunar_new_year to use Chinese New Year instead."},{"q":"What happens when the formula gives 5?","a":"There is no trigram 5 (the Luoshu centre), so tradition assigns men to 坤 (2) and women to 艮 (8)."}],"tags":["kua number","ming gua","命卦","eight mansions","八宅","feng shui directions"],"related":[{"calculator_id":"bagua","reason":"Attributes of the resulting trigram."},{"calculator_id":"luoshu-square","reason":"The square whose numbers define the Kua numbers."},{"calculator_id":"chinese-zodiac","reason":"Zodiac animal and stem-branch of the same birth year."}],"links":{"html":"https://tttkmbb.com/yijing/ming-gua","markdown":"https://tttkmbb.com/yijing/ming-gua.md","json":"https://tttkmbb.com/yijing/ming-gua.json","api":"https://tttkmbb.com/api/v1/calculate/ming-gua","schema":"https://tttkmbb.com/api/v1/calculators/ming-gua","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T08:30:42Z"}