关于「二十四山的离散化与罗盘误差」,《飞星置换、罗盘离散与骨相计量》给出的定量结论是什么?

结论:第三章计算罗盘误差的后果:误差标准差 3 度时 0.1594 的读数跨山,九运盘面改变 0.1063,兼向的判断翻转 0.3118;不说明以哪一个北为准时,磁偏角 5 度使 0.3333 的房子换山。

数据口径:罗盘误差、磁偏角、面部尺寸与标点误差都是示意参数;排盘规则按书中写明的约定执行。 书中以标注框区分证据、可运行的 Python 程序、原典与假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.1063, 0.1594, 0.3118

   sigma   mountain   palace   chart (p9)   jian xiang   kong wang
       1     0.0531   0.0177       0.0354       0.1063      0.1062
       2     0.1063   0.0354       0.0708       0.2124      0.1970
       3     0.1594   0.0531       0.1063       0.3118      0.2524
       4     0.2125   0.0708       0.1417       0.3896      0.2848
       5     0.2655   0.0886       0.1770       0.4389      0.3043
   check: mountain rate = E|error| / 15
   = sigma sqrt(2 / pi) / 15,
   which is 0.1596 at sigma 3
Reading: with an error of 2 to 3 degrees, one reading in
nine to one in six names the wrong mountain, and the chart
for period 9 changes two times in three of those. The status
of being near an edge, which decides whether replacement
charts apply, is the least stable of all: an error of 3
degrees flips it for 0.3118 of houses.
查看完整验算程序
# Chapter 3. p05: Compass error and how often the chart changes.
# Twenty-four mountains of 15 degrees; ren is centred on 345 degrees.
# A true facing direction, uniform around the circle, is read with a
# normal error of standard deviation sigma (2 to 5 degrees covers
# a careful reading near steel, concrete and wiring). We report the
# probability that the reading
#   names a different mountain (kua shan);
#   names a different palace, that is trigram (chu gua);
#   changes the chart of period 9 (both side charts compared);
#   changes the "near an edge" status, within 3 degrees of a mountain
#     boundary (jian xiang, where replacement charts are used);
#   changes the "void" status, within 1.5 degrees of a boundary
#     (kong wang).
# Integration on a 0.1 degree grid of true angles and an 81-point grid
# of errors from -4 to +4 sigma.
import math

LOSHU = {"SE": 4, "S": 9, "SW": 2, "E": 3, "C": 5, "W": 7,
         "NE": 8, "N": 1, "NW": 6}
PALACE_OF = {v: k for k, v in LOSHU.items()}
PATH = ["C", "NW", "W", "NE", "S", "N", "SW", "E", "SE"]
OPP = {"N": "S", "S": "N", "E": "W", "W": "E", "NE": "SW", "SW": "NE",
       "NW": "SE", "SE": "NW"}
PAL_ORDER = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"]
MOUNTAINS = ("ren zi gui chou gen yin jia mao yi chen xun si bing wu "
             "ding wei kun shen geng you xin xu qian hai").split()

def norm(x):
    return (x - 1) % 9 + 1

def fly(c, sign):
    return {p: norm(c + sign * k) for k, p in enumerate(PATH)}

def polarity(number, pos):
    cardinal = number in (1, 3, 7, 9)
    return (1, -1, -1)[pos] if cardinal else (-1, 1, 1)[pos]

def side(base, pal, pos):
    n = base[pal]
    ref = LOSHU[pal] if n == 5 else n
    return fly(n, polarity(ref, pos))

def chart(period, i):
    base = fly(period, 1)
    sit = PAL_ORDER[i // 3]
    face = OPP[sit]
    return base, side(base, sit, i % 3), side(base, face, i % 3), sit, face

def category(period, i):
    base, m, f, sit, face = chart(period, i)
    if m[sit] == period and f[face] == period:
        return "wang shan wang xiang"
    if m[face] == period and f[sit] == period:
        return "shang shan xia shui"
    if m[face] == period and f[face] == period:
        return "shuang xing hui xiang"
    return "shuang xing hui zuo"

def m_index(deg):
    return int(((deg - 337.5) % 360) // 15)

def edge_dist(deg):
    x = (deg - 337.5) % 15
    return min(x, 15 - x)

CHARTS = [chart(9, i)[1:3] for i in range(24)]

def rates(sigma):
    errs = [-4 * sigma + 0.1 * sigma * k for k in range(81)]
    w = [math.exp(-0.5 * (e / sigma) ** 2) for e in errs]
    sw = sum(w)
    tot = [0.0] * 5
    n = 0
    for t10 in range(3600):
        t = t10 / 10 + 0.05
        mi, ed = m_index(t), edge_dist(t)
        for e, wt in zip(errs, w):
            r = t + e
            mj, er = m_index(r), edge_dist(r)
            tot[0] += wt * (mi != mj)
            tot[1] += wt * (mi // 3 != mj // 3)
            tot[2] += wt * (CHARTS[mi] != CHARTS[mj])
            tot[3] += wt * ((ed < 3) != (er < 3))
            tot[4] += wt * ((ed < 1.5) != (er < 1.5))
        n += 1
    return [x / (sw * n) for x in tot]

if __name__ == "__main__":
    print("   sigma   mountain   palace   chart (p9)   jian xiang"
          "   kong wang")
    for s in (1, 2, 3, 4, 5):
        r = rates(float(s))
        print("   {:5d} {:10.4f} {:8.4f} {:12.4f} {:12.4f} {:11.4f}".format(
            s, *r))
    print("   check: mountain rate = E|error| / 15")
    print("   = sigma sqrt(2 / pi) / 15,")
    print("   which is {:.4f} at sigma 3".format(
        3 * math.sqrt(2 / math.pi) / 15))
    print("\nReading: with an error of 2 to 3 degrees, one reading in")
    print("nine to one in six names the wrong mountain, and the chart")
    print("for period 9 changes two times in three of those. The status")
    print("of being near an edge, which decides whether replacement")
    print("charts apply, is the least stable of all: an error of 3")
    print("degrees flips it for 0.3118 of houses.")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《玄空飞星置换代数、二十四山罗盘离散化与骨相比例计量》第 3 章「二十四山的离散化与罗盘误差」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090215

DOI: 10.5281/zenodo.24090215 · 阅读本章所在专著 · 5DL-B-082 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026082,
  author    = {Fan, Yafu},
  title     = {Xuankong Flying-Star Permutations, Twenty-Four-Mountain Compass Discretization and Craniofacial Ratio Metrology},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.24090215},
  url       = {https://doi.org/10.5281/zenodo.24090215}
}

本书其他章节结论