5D Library › 玄空飞星置换代数、二十四山罗盘离散化与骨相比例计量 · English
第七章 沈括论指南针与玄空、相法的文本
为什么在这里读这些文献
本书前三章的计算依赖两件事:一是罗盘如何读数,二是排盘规则如何约定。第一件事,北宋沈括在《梦溪笔谈》中留下了世界上最早关于磁偏角的明确记述之一,同时比较了几种安放磁针的方法 (Needham 1962)。第二件事的规则,来自清代蒋大鸿《地理辨正》以降的玄空一系,而民国沈竹礽的《沈氏玄空学》把飞星排盘写成了今天通行的形式,风水在中国社会中的历史与实践可参看 Bruun 的研究 (Bruun 2003);骨相比例的说法则多出自旧题麻衣道者所传的《麻衣神相》一系相书。本章引用的《梦溪笔谈》原文已与所列底本逐字核对。后三部书本书未能取得可供逐字核对的底本,因此只说明它们在本书中的位置,不作引文。
《梦溪笔谈》:针常微偏东
原典
沈括《梦溪笔谈》卷二十四「杂志一」(Project Gutenberg 所录本)
方家以磁石磨針鋒,則能指南,然常微偏東,不全南也,水浮多蕩搖。
指爪及碗唇上皆可為之,運轉尤速,但堅滑易墜,不若縷懸為最善。
其法取新纊中獨茧縷,以芥子許蜡,綴于針腰,無風處懸之,則針常指南。
其中有磨而指北者。余家指南、北者皆有之。磁石之指南,猶柏之指西,莫可原其理。
沈括记下了三件对本书至关重要的事。其一,磁针「常微偏东,不全南也」,这正是磁偏角。其二,他比较了四种安放磁针的方法:浮在水上「多荡摇」,放在指甲或碗沿上「运转尤速」却易坠落,以单根新丝悬挂「为最善」。这是一次关于测量误差的比较。其三,他坦言「莫可原其理」:他记录了现象,却不为现象编造解释。
推导
# Chapter 7. p14: Shen Kuo's four ways to hang a needle, and the counts
# behind the classical charts.
# Shen Kuo compares a needle floated on water, balanced on a fingernail,
# balanced on the rim of a bowl, and hung from a single silk thread,
# and notes that the needle points slightly east of south. We give each
# method an illustrative reading error sigma (degrees) and compute the
# chance of naming the wrong mountain (15 degrees) or the wrong palace
# (45 degrees) for a uniform facing: E|error| / width, with
# E|error| = sigma sqrt(2 / pi). A steady declination d moves a share
# d / 15 of facings to the next mountain. Last, the counts that frame
# the classical method: 9 periods of 20 years; 24 mountains x 9
# periods ordinary charts; the same again as replacement charts.
import math
METHODS = [("floated on water", 6.0), ("on a fingernail", 4.0),
("on a bowl rim", 4.0), ("hung from a silk thread", 1.5)]
if __name__ == "__main__":
print(" method sigma wrong mountain"
" wrong palace")
for name, s in METHODS:
e = s * math.sqrt(2 / math.pi)
print(" {:24s} {:6.1f} {:16.4f} {:14.4f}".format(
name, s, e / 15, e / 45))
for d in (1.0, 3.0, 5.0):
print(" declination {:.0f} deg moves {:.4f} of facings".format(
d, d / 15))
print("\n periods x years: {} x {} = {} years".format(9, 20, 9 * 20))
print(" ordinary charts: {} x {} = {}".format(24, 9, 24 * 9))
print(" with replacement charts: {}".format(2 * 24 * 9))
# method sigma wrong mountain wrong palace
# floated on water 6.0 0.3192 0.1064
# on a fingernail 4.0 0.2128 0.0709
# on a bowl rim 4.0 0.2128 0.0709
# hung from a silk thread 1.5 0.0798 0.0266
# declination 1 deg moves 0.0667 of facings
# declination 3 deg moves 0.2000 of facings
# declination 5 deg moves 0.3333 of facings
#
# periods x years: 9 x 20 = 180 years
# ordinary charts: 24 x 9 = 216
# with replacement charts: 432程序给四种方法各设一个示意的读数误差:水浮 6 度,指甲与碗沿各 4 度,丝悬 1.5 度。对均匀分布的朝向,水浮法读错山的概率为 0.3192,读错宫的概率为 0.1064;丝悬法分别只有 0.0798 与 0.0266。「微偏东」若为 3 度,未经改正就有 0.2000 的朝向换山。沈括选择丝悬,正是选择了最小的测量误差;他对偏东的记录,提醒每一位用罗盘的人说明以哪一个北为准。
玄空与相法:结构而非引文
本书第一、二章所用的结构,即三元九运(每运 20 年、九运 180 年)、二十四山、山星与向星按元龙阴阳顺逆飞行、替卦,属于蒋大鸿《地理辨正》所开启、经《沈氏玄空学》整理的玄空飞星一系。按这些规则,下卦盘共 24 × 9 = 216 个,连同替卦共 432 个,程序最后一段列出这些计数。本书对规则的写法采用当代通行的约定,并在第一、二章逐条写明;凡约定有分歧之处(例如替卦的飞行方向),本书同时计算两种约定,而不替任何一家裁决。
《麻衣神相》一系相书以三停、五岳、十二宫等结构描述面相。本书第四、五章只讨论其中可以测量的部分(三停与五眼的比例),以及测量这些比例时的基础比率、透视与误差;书中不引用相书原文,也不评价任何解读。
小结
沈括的记述同时包含了磁偏角的发现与一次测量误差的比较,并以「莫可原其理」示范了只记录、不臆造的态度。玄空飞星与相法的文本在本书中只作为规则与结构的来源;它们的规则可以写成精确的算术,而算术本身不含吉凶。
参考文献
Fan, Y. (2026). Xuankong Flying-Star Permutations, Twenty-Four-Mountain Compass Discretization and Craniofacial Ratio Metrology: Lo-Shu Orbit Cycles, Magnetic Declination Flip Rates and Landmark Measurement Error Propagation [玄空飞星置换代数、二十四山罗盘离散化与骨相比例计量] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090215 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).