文章快速检索 高级检索
 大地测量与地球动力学  2020, Vol. 40 Issue (6): 608-611  DOI: 10.14075/j.jgg.2020.06.012

### 引用本文

ZHANG Hanwei, ZHANG Hongli, YU Zhengzheng. Derivation of Spherical Triangle Formula Using Quaternion Algorithm[J]. Journal of Geodesy and Geodynamics, 2020, 40(6): 608-611.

### Foundation support

National Natural Science Foundation of China, No.41474021, 41931075.

### 第一作者简介

ZHANG Hanwei, PhD, professor, PhD supervisor, majors in geodetic teaching and research, E-mail: zhanwei800@163.com.

### 文章历史

1. 河南理工大学测绘与国土信息学院，河南省焦作市世纪大道2001号，454003;
2. 许昌学院城乡规划与园林学院，河南省许昌市八一路88号，461000

1 四元数的定义与性质

 $\mathit{\boldsymbol{P}} = {\mathit{\boldsymbol{p}}_0} + \mathit{\boldsymbol{p}}, \mathit{\boldsymbol{Q}} = {\mathit{\boldsymbol{q}}_0} + \mathit{\boldsymbol{q}}$

 $\mathit{\boldsymbol{P}} \circ \mathit{\boldsymbol{Q}} = ({\mathit{\boldsymbol{p}}_0}{\mathit{\boldsymbol{q}}_0} - \mathit{\boldsymbol{p}} \cdot \mathit{\boldsymbol{q}}) + ({\mathit{\boldsymbol{p}}_0}\mathit{\boldsymbol{q}} + {\mathit{\boldsymbol{q}}_0}\mathit{\boldsymbol{p}} + \mathit{\boldsymbol{p}} \times \mathit{\boldsymbol{q}})$ (1)

 $\left\{ {\begin{array}{*{20}{l}} {{\mathit{\boldsymbol{Q}}^*} = {\mathit{\boldsymbol{q}}_0} - \mathit{\boldsymbol{q}}}\\ {\left\| \mathit{\boldsymbol{Q}} \right\| = |\mathit{\boldsymbol{Q}}{|^2} = \mathit{\boldsymbol{Q}} \circ {\mathit{\boldsymbol{Q}}^*} = {\mathit{\boldsymbol{Q}}^*} \circ \mathit{\boldsymbol{Q}} = \mathit{\boldsymbol{q}}_0^2 + \mathit{\boldsymbol{q}} \cdot \mathit{\boldsymbol{q}}}\\ {{\mathit{\boldsymbol{Q}}^{ - 1}} = {{\left\| \mathit{\boldsymbol{Q}} \right\|}^{ - 1}}{\mathit{\boldsymbol{Q}}^*}} \end{array}} \right.$ (2)

2 单位四元数

 $\mathit{\boldsymbol{\hat Q}} = {\rm{cos}}\theta + \mathit{\boldsymbol{\hat qsin}}\theta$ (3)

 图 1 四元数在单位圆上的表示 Fig. 1 The representation of quaternion on a unit circle
3.1 单位四元数在单位圆上的表示

 $\theta \mathit{\boldsymbol{\hat q}} = \overset\frown{AB} \buildrel \wedge \over = \mathit{\boldsymbol{\hat Q}} = {\rm{cos}}\theta + \mathit{\boldsymbol{\hat q}}{\rm{sin}}\theta = \mathit{\boldsymbol{\hat b}} \circ {{\mathit{\boldsymbol{\hat a}}}^{ - 1}}$ (5)

 $\begin{array}{*{20}{c}} { - \theta \mathit{\boldsymbol{\hat q}} = \overset\frown{BA} \buildrel \wedge \over = {{\mathit{\boldsymbol{\hat Q}}}^{ - 1}} = {{\mathit{\boldsymbol{\hat Q}}}^*} = }\\ {{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{cos}}\theta - \mathit{\boldsymbol{\hat q}}{\rm{sin}}\theta = \mathit{\boldsymbol{\hat a}} \circ {{\mathit{\boldsymbol{\hat b}}}^{ - 1}}} \end{array}$

 $\begin{array}{*{20}{c}} { - \mathit{\boldsymbol{\hat Q}} = - {\rm{cos}}\theta - \mathit{\boldsymbol{\hat q}}{\rm{sin}}\theta = - \mathit{\boldsymbol{\hat b}} \circ {{\mathit{\boldsymbol{\hat a}}}^{ - 1}} = }\\ {\mathit{\boldsymbol{\hat b}} \circ {{( - \mathit{\boldsymbol{\hat a}})}^{ - 1}} \buildrel \wedge \over = - (\pi - \theta )\mathit{\boldsymbol{\hat q}} = \overset\frown{A'B}} \end{array}$

3.2 球面三角形边和角的四元数表示

 图 3 球面三角形与单位四元数 Fig. 3 Spherical triangle and unit quaternion
 $\begin{array}{*{20}{l}} {{{\mathit{\boldsymbol{\hat a}}}_ \bot } = \frac{{\mathit{\boldsymbol{\hat b}} \times \mathit{\boldsymbol{\hat c}}}}{{\mathit{\boldsymbol{\hat b}} \times \mathit{\boldsymbol{\hat c}}}} = \frac{{\mathit{\boldsymbol{\hat b}} \times \mathit{\boldsymbol{\hat c}}}}{{{\rm{sin}}a}}, }\\ {{{\mathit{\boldsymbol{\hat b}}}_ \bot } = \frac{{\mathit{\boldsymbol{\hat c}} \times \mathit{\boldsymbol{\hat a}}}}{{|\mathit{\boldsymbol{\hat c}} \times \mathit{\boldsymbol{\hat a}}|}} = \frac{{\mathit{\boldsymbol{\hat c}} \times \mathit{\boldsymbol{\hat a}}}}{{{\rm{sin}}b}}, }\\ {{{\mathit{\boldsymbol{\hat c}}}_ \bot } = \frac{{\mathit{\boldsymbol{\hat a}} \times \mathit{\boldsymbol{\hat b}}}}{{|\mathit{\boldsymbol{\hat a}} \times \mathit{\boldsymbol{\hat b}}|}} = \frac{{\mathit{\boldsymbol{\hat a}} \times \mathit{\boldsymbol{\hat b}}}}{{{\rm{sin}}c}}} \end{array}$

 $\left\{ \begin{array}{l} \begin{array}{*{20}{c}} {A\mathit{\boldsymbol{\hat a}} \buildrel \wedge \over = {\mathit{\boldsymbol{A}}_{{\rm{角}}}} = {{\mathit{\boldsymbol{\hat b}}}_ \bot } \circ \mathit{\boldsymbol{\hat c}}_ \bot ^{ - 1} = {\rm{cos}}(\pi + A) + }\\ {\mathit{\boldsymbol{\hat a}}{\rm{sin}}(\pi + A) = {{\mathit{\boldsymbol{\hat c}}}_ \bot } \cdot {{\mathit{\boldsymbol{\hat b}}}_ \bot } + {{\mathit{\boldsymbol{\hat c}}}_ \bot } \times {{\mathit{\boldsymbol{\hat b}}}_ \bot }} \end{array}\\ \begin{array}{*{20}{c}} {B\mathit{\boldsymbol{\hat b}} \buildrel \wedge \over = {\mathit{\boldsymbol{B}}_{{\rm{角}}}} = {{\mathit{\boldsymbol{\hat c}}}_ \bot } \circ \mathit{\boldsymbol{\hat a}}_ \bot ^{ - 1} = {\rm{cos}}(\pi + B)}\\ {\mathit{\boldsymbol{\hat b}}{\rm{sin}}(\pi + B) = {{\mathit{\boldsymbol{\hat a}}}_ \bot } \cdot {{\mathit{\boldsymbol{\hat c}}}_ \bot } + {{\mathit{\boldsymbol{\hat a}}}_ \bot } \times {{\mathit{\boldsymbol{\hat c}}}_ \bot }} \end{array}\\ \begin{array}{*{20}{c}} {C\mathit{\boldsymbol{\hat c}} \buildrel \wedge \over = {\mathit{\boldsymbol{C}}_{{\rm{角}}}} = {{\mathit{\boldsymbol{\hat a}}}_ \bot } \circ \mathit{\boldsymbol{\hat b}}_ \bot ^{ - 1} = {\rm{cos}}(\pi + C) + }\\ {\mathit{\boldsymbol{\hat c}}{\rm{sin}}(\pi + C) = {{\mathit{\boldsymbol{\hat b}}}_ \bot } \cdot {{\mathit{\boldsymbol{\hat a}}}_ \bot } + {{\mathit{\boldsymbol{\hat b}}}_ \bot } \times {{\mathit{\boldsymbol{\hat a}}}_ \bot }} \end{array} \end{array} \right.$ (8)

 $\left\{ \begin{array}{l} \begin{array}{*{20}{l}} {a{{\mathit{\boldsymbol{\hat a}}}_ \bot } = \overset\frown {BC} \buildrel \wedge \over = {\mathit{\boldsymbol{a}}_{{\rm{边}}}} = \mathit{\boldsymbol{\hat c}} \circ {{\mathit{\boldsymbol{\hat b}}}^{ - 1}} = {\rm{cos}}a + }\\ {{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {{\mathit{\boldsymbol{\hat a}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}a = \mathit{\boldsymbol{\hat b}} \cdot \mathit{\boldsymbol{\hat c}} + \mathit{\boldsymbol{\hat b}} \times \mathit{\boldsymbol{\hat c}}} \end{array}\\ \begin{array}{*{20}{l}} {b{{\mathit{\boldsymbol{\hat b}}}_ \bot } = \overset\frown {CA} \buildrel \wedge \over = {\mathit{\boldsymbol{b}}_{{\rm{边}}}} = \mathit{\boldsymbol{\hat a}} \circ {{\mathit{\boldsymbol{\hat c}}}^{ - 1}} = {\rm{cos}}b + }\\ {{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {{\mathit{\boldsymbol{\hat b}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}b = \mathit{\boldsymbol{\hat c}} \cdot \mathit{\boldsymbol{\hat a}} + \mathit{\boldsymbol{\hat c}} \times \mathit{\boldsymbol{\hat a}}} \end{array}\\ \begin{array}{*{20}{l}} {c{{\mathit{\boldsymbol{\hat c}}}_ \bot } = \overset\frown {AB} \buildrel \wedge \over = {\mathit{\boldsymbol{c}}_{{\rm{边}}}} = \mathit{\boldsymbol{\hat b}} \circ {{\mathit{\boldsymbol{\hat a}}}^{ - 1}} = {\rm{cos}}c + }\\ {{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {{\mathit{\boldsymbol{\hat c}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}c = \mathit{\boldsymbol{\hat a}} \cdot \mathit{\boldsymbol{\hat b}} + \mathit{\boldsymbol{\hat a}} \times \mathit{\boldsymbol{\hat b}}} \end{array} \end{array} \right.$ (9)
4.1 边余弦公式、第一五元素公式和正弦公式推导

 ${\mathit{\boldsymbol{c}}_{{\rm{边}}}} \circ {\mathit{\boldsymbol{b}}_{{\rm{边}}}} = (\mathit{\boldsymbol{\hat b}} \circ {\mathit{\boldsymbol{\hat a}}^{ - 1}}) \circ (\mathit{\boldsymbol{\hat a}} \circ {\mathit{\boldsymbol{\hat c}}^{ - 1}}) = \mathit{\boldsymbol{\hat b}} \circ {\mathit{\boldsymbol{\hat c}}^{ - 1}} = \mathit{\boldsymbol{a}}_{{\rm{边}}}^{ - 1}$

 $\begin{array}{*{20}{c}} {{\rm{cos}}a - {{\mathit{\boldsymbol{\hat a}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}a = }\\ {({\rm{cos}}c + {{\mathit{\boldsymbol{\hat c}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}c) \cdot ({\rm{cos}}b + {{\mathit{\boldsymbol{\hat b}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}b)} \end{array}$ (10)

 ${\rm{cos}}a = {\rm{cos}}b{\rm{cos}}c - {\mathit{\boldsymbol{\hat c}}_ \bot } \cdot {\mathit{\boldsymbol{\hat b}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}b{\rm{sin}}c$

 ${\rm{cos}}a = {\rm{cos}}b{\rm{cos}}c + {\rm{sin}}b{\rm{sin}}c{\rm{cos}}A$ (11)

 $\begin{array}{*{20}{c}} { - {{\mathit{\boldsymbol{\hat a}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}a = {{\mathit{\boldsymbol{\hat c}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{cos}}b{\rm{sin}}c + }\\ {{{\mathit{\boldsymbol{\hat b}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}b{\rm{cos}}c + {{\mathit{\boldsymbol{\hat c}}}_ \bot } \times {{\mathit{\boldsymbol{\hat b}}}_ \bot }{\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\rm{sin}}b{\rm{sin}}c} \end{array}$ (12)

 $\left\{ \begin{array}{l} {\rm{sin}}A{\rm{cos}}c = {\rm{cos}}C{\rm{sin}}B + {\rm{sin}}C{\rm{cos}}B{\rm{cos}}a\\ {\rm{sin}}A{\rm{cos}}b = {\rm{cos}}B{\rm{sin}}C + {\rm{sin}}B{\rm{cos}}C{\rm{cos}}a \end{array} \right.$ (24)

 $\begin{array}{*{20}{l}} {\mathit{\boldsymbol{\hat b}} \cdot {{\mathit{\boldsymbol{\hat a}}}_ \bot } = \mathit{\boldsymbol{\hat c}} \cdot {{\mathit{\boldsymbol{\hat a}}}_ \bot } = 0, \mathit{\boldsymbol{\hat b}} \times \mathit{\boldsymbol{\hat c}} = }\\ {{\rm{sin}}a{{\mathit{\boldsymbol{\hat a}}}_ \bot }, \mathit{\boldsymbol{\hat a}} \cdot {{\mathit{\boldsymbol{\hat a}}}_ \bot } = \frac{{\mathit{\boldsymbol{\hat a}} \cdot (\mathit{\boldsymbol{\hat b}} \times \mathit{\boldsymbol{\hat c}})}}{{{\rm{sin}}a}}} \end{array}$

 $\begin{array}{l} \begin{array}{*{20}{c}} {{\mathit{\boldsymbol{C}}_{{\rm{角}}}} \circ {\mathit{\boldsymbol{A}}_{{\rm{角}}}} = ({{\mathit{\boldsymbol{\hat a}}}_ \bot } \circ \mathit{\boldsymbol{\hat b}}_ \bot ^{ - 1}) \circ ({{\mathit{\boldsymbol{\hat b}}}_ \bot } \circ \mathit{\boldsymbol{\hat c}}_ \bot ^{ - 1})}\\ {{{\mathit{\boldsymbol{\hat a}}}_ \bot } \circ \mathit{\boldsymbol{\hat c}}_ \bot ^{ - 1} = \mathit{\boldsymbol{B}}_{{\rm{角}}}^{ - 1}} \end{array}\\ \begin{array}{*{20}{c}} {{\mathit{\boldsymbol{A}}_{{\rm{角}}}} \circ {\mathit{\boldsymbol{B}}_{{\rm{角}}}} = ({{\mathit{\boldsymbol{\hat b}}}_ \bot } \circ \mathit{\boldsymbol{\hat c}}_ \bot ^{ - 1}) \circ ({{\mathit{\boldsymbol{\hat c}}}_ \bot } \circ \mathit{\boldsymbol{\hat a}}_ \bot ^{ - 1}) = }\\ {{{\mathit{\boldsymbol{\hat b}}}_ \bot } \circ \mathit{\boldsymbol{\hat a}}_ \bot ^{ - 1} = \mathit{\boldsymbol{C}}_{{\rm{角}}}^{ - 1}} \end{array} \end{array}$

 $\left\{ {\begin{array}{*{20}{l}} {{\rm{cos}}B = - {\rm{cos}}C{\rm{cos}}A + {\rm{sin}}C{\rm{sin}}A{\rm{cos}}b}\\ {{\rm{cos}}C = - {\rm{cos}}A{\rm{cos}}B + {\rm{sin}}A{\rm{sin}}B{\rm{cos}}c} \end{array}} \right.$ (26)

 $\left\{ {\begin{array}{*{20}{l}} {{\rm{sin}}B{\rm{cos}}a = {\rm{cos}}A{\rm{sin}}C + {\rm{sin}}A{\rm{cos}}C{\rm{cos}}b}\\ {{\rm{sin}}B{\rm{cos}}c = {\rm{cos}}C{\rm{sin}}A + {\rm{sin}}C{\rm{cos}}A{\rm{cos}}b} \end{array}} \right.$ (27)
 $\left\{ {\begin{array}{*{20}{l}} {{\rm{sin}}C{\rm{cos}}b = {\rm{cos}}B{\rm{sin}}A + {\rm{sin}}B{\rm{cos}}A{\rm{cos}}c}\\ {{\rm{sin}}C{\rm{cos}}a = {\rm{cos}}A{\rm{sin}}B + {\rm{sin}}A{\rm{cos}}B{\rm{cos}}c} \end{array}} \right.$ (28)

 $\frac{{{\rm{sin}}A{\rm{sin}}B{\rm{si}}{{\rm{n}}^2}c}}{{{\rm{sin}}C}} = \mathit{\boldsymbol{\hat c}} \cdot (\mathit{\boldsymbol{\hat a}} \times \mathit{\boldsymbol{\hat b}}){\kern 1pt}$ (30)

5 结语

 [1] 程薇.四元数矩阵代数中的若干问题研究[D].长沙: 国防科学技术大学, 2009 (Cheng Wei. Researches on Some Problems of Quaternion Matrix Algebra[D]. Changsha: National University of Defense Technology, 2009) http://cdmd.cnki.com.cn/article/cdmd-90002-2009213117.htm (0) [2] Vince J. Imaginary Mathematics for Computer Science[M]. Berlin: Springer International Publishing, 2018 (0) [3] Svehla D. Geometrical Theory of Satellite Orbits and Gravity Field[M]. Berlin: Springer International Publishing, 2018 (0) [4] 高宁, 赵星涛, 纪磊, 等. 单位四元数和物方几何约束的绝对定向[J]. 测绘科学, 2018, 43(9): 22-27 (Gao Ning, Zhao Xingtao, Ji Lei, et al. An Absolute Orientation Method for Unit Quaternion and Object Geometric Constraints[J]. Science of Surveying and Mapping, 2018, 43(9): 22-27) (0) [5] Hamilton W R. Lecture on Quaternions[M]. London: Cambridge Press, 1853 (0)
Derivation of Spherical Triangle Formula Using Quaternion Algorithm
ZHANG Hanwei1     ZHANG Hongli1     YU Zhengzheng1,2
1. School of Surveying and Land Information Engineering, Henan Polytechnic University, 2001 Shiji Road, Jiaozuo 454003, China;
2. School of Urban and Rural Planning and Landscape Architecture, Xuchang University, 88 Bayi Road, Xuchang 461000, China
Abstract: Based on the quaternion algorithm, we introduce the concepts of the conjugate and inverse of vectors and the Glassman product, which represents another multiplication of two vectors. The quaternion corresponding to a large arc on a sphere is the inverse of Glassman product of the unit vector, whose center points to the end of the large arc, and the unit vector whose center points to the beginning of the large arc. The quaternion corresponding to spherical angle is the inverse of Glassman product of the unit vector of normal plane of the final arc(toward the vertex) and the unit vector of plane normal of the initial arc (away from the vertex). It is easy to derive spherical trigonometry formulae using the quaternion algorithm, including sinusoidal and cosine formulae, and the first and second five elements formulae.
Key words: quaternion; Glassman product; the conjugate and inverse of vectors; formulae of spherical trigonometry