Zone Model
icosahedron
正二十面体 https://baike.baidu.com/item/%E6%AD%A3%E4%BA%8C%E5%8D%81%E9%9D%A2%E4%BD%93/1921640
正二十面体(Regular icosahedron [2] ) 是由20个等边三角形所组成的正多面体,共有12个顶点,30条棱,20个面。为五个柏拉图多面体之一。
sqrt(50-10*sqrt(5))/10 = 0.5257
sqrt(50+10*sqrt(5))/10 = 0.8507
画图十分精美
https://www.redblobgames.com/x/1842-delaunay-voronoi-sphere/
% plot_triangle.m |
function plot_triangle(A,d1,d2,d3) |
进入源码进行查看
StelGeodesicGrid::StelGeodesicGrid(StelGeodesicGrid.cpp) 被调用1次 调用20次
StelGeodesicGrid::initTriangle(StelGeodesicGrid.cpp)被调用20次 c0/c1/c2为20个面的3个点,函数内的循环没进
下面6个点为 c0/c1/c2/e0/e1/e2
1 [0.850651, 0.525731, 0] [0.850651, -0.525731, 0] [0.525731, 0, -0.850651] [0.809017, -0.309017, -0.5] [0.809017, 0.309017, -0.5] [1, 0, 0]
2 [0.850651, -0.525731, 0] [0.850651, 0.525731, 0] [0.525731, 0, 0.850651] [0.809017, 0.309017, 0.5] [0.809017, -0.309017, 0.5] [1, 0, 0]
3 [0.850651, -0.525731, 0] [0.525731, 0, 0.850651] [0, -0.850651, 0.525731] [0.309017, -0.5, 0.809017] [0.5, -0.809017, 0.309017] [0.809017, -0.309017, 0.5]
4 [0.525731, 0, 0.850651] [-0.525731, 0, 0.850651] [0, -0.850651, 0.525731] [-0.309017, -0.5, 0.809017] [0.309017, -0.5, 0.809017] [0, 0, 1]
5 [0.850651, -0.525731, 0] [0, -0.850651, -0.525731] [0.525731, 0, -0.850651] [0.309017, -0.5, -0.809017] [0.809017, -0.309017, -0.5] [0.5, -0.809017, -0.309017]
6 [0, -0.850651, 0.525731] [0, -0.850651, -0.525731] [0.850651, -0.525731, 0] [0.5, -0.809017, -0.309017] [0.5, -0.809017, 0.309017] [0, -1, 0]
7 [0, -0.850651, -0.525731] [0, -0.850651, 0.525731] [-0.850651, -0.525731, 0] [-0.5, -0.809017, 0.309017] [-0.5, -0.809017, -0.309017] [0, -1, 0]
8 [0, -0.850651, 0.525731] [-0.525731, 0, 0.850651] [-0.850651, -0.525731, 0] [-0.809017, -0.309017, 0.5] [-0.5, -0.809017, 0.309017] [-0.309017, -0.5, 0.809017]
9 [-0.525731, 0, -0.850651] [0.525731, 0, -0.850651] [0, -0.850651, -0.525731] [0.309017, -0.5, -0.809017] [-0.309017, -0.5, -0.809017] [0, 0, -1]
10 [0, -0.850651, -0.525731] [-0.850651, -0.525731, 0] [-0.525731, 0, -0.850651] [-0.809017, -0.309017, -0.5] [-0.309017, -0.5, -0.809017] [-0.5, -0.809017, -0.309017]
11 [-0.850651, -0.525731, 0] [-0.850651, 0.525731, 0] [-0.525731, 0, -0.850651] [-0.809017, 0.309017, -0.5] [-0.809017, -0.309017, -0.5] [-1, 0, 0]
12 [-0.850651, 0.525731, 0] [-0.850651, -0.525731, 0] [-0.525731, 0, 0.850651] [-0.809017, -0.309017, 0.5] [-0.809017, 0.309017, 0.5] [-1, 0, 0]
13 [0.525731, 0, -0.850651] [-0.525731, 0, -0.850651] [0, 0.850651, -0.525731] [-0.309017, 0.5, -0.809017] [0.309017, 0.5, -0.809017] [0, 0, -1]
14 [-0.850651, 0.525731, 0] [0, 0.850651, -0.525731] [-0.525731, 0, -0.850651] [-0.309017, 0.5, -0.809017] [-0.809017, 0.309017, -0.5] [-0.5, 0.809017, -0.309017]
15 [0, 0.850651, 0.525731] [0, 0.850651, -0.525731] [-0.850651, 0.525731, 0] [-0.5, 0.809017, -0.309017] [-0.5, 0.809017, 0.309017] [0, 1, 0]
16 [-0.850651, 0.525731, 0] [-0.525731, 0, 0.850651] [0, 0.850651, 0.525731] [-0.309017, 0.5, 0.809017] [-0.5, 0.809017, 0.309017] [-0.809017, 0.309017, 0.5]
17 [0, 0.850651, -0.525731] [0.850651, 0.525731, 0] [0.525731, 0, -0.850651] [0.809017, 0.309017, -0.5] [0.309017, 0.5, -0.809017] [0.5, 0.809017, -0.309017]
18 [0, 0.850651, -0.525731] [0, 0.850651, 0.525731] [0.850651, 0.525731, 0] [0.5, 0.809017, 0.309017] [0.5, 0.809017, -0.309017] [0, 1, 0]
19 [0, 0.850651, 0.525731] [0.525731, 0, 0.850651] [0.850651, 0.525731, 0] [0.809017, 0.309017, 0.5] [0.5, 0.809017, 0.309017] [0.309017, 0.5, 0.809017]
20 [-0.525731, 0, 0.850651] [0.525731, 0, 0.850651] [0, 0.850651, 0.525731] [0.309017, 0.5, 0.809017] [-0.309017, 0.5, 0.809017] [0, 0, 1]
然后才进入了下面的程序
StarMgr::init()
StelGeodesicGrid::visitTriangles 被调用1次 调用20次函数
StelGeodesicGrid::visitTriangles 被调用20次 再每次调用自身4次函数
(*func)(lev, index, c0, c1, c2, context);
initTriangleFunc (StarMgr.hpp)
StarMgr::initTriangle 被调用1次
ZoneArray::initTriangle
需要注意调用了100次的 StelGeodesicGrid::visitTriangles 中的 Triangle &t(triangles [ lev ] [ index ] );
struct Triangle |
triangles变量在StelGeodesicGrid::initTriangle中已经定义过
checkAndLoadCatal visitTriangles 1
1 z->center [0.934172, 0, -0.356822] z->axis0 [0, 1, 0] z->axis1 [0.356822, 0, 0.934172] star_position_scale 0.763932 c0 [0.850651, 0.525731, 0] c1 [0.850651, -0.525731, 0] c2 [0.525731, 0, -0.850651]
2 z->center [0.939124, 0.294748, -0.176549] z->axis0 [-0.299452, 0.954111, 0] z->axis1 [0.168448, 0.052868, 0.984292] star_position_scale 0.361541 c0 [0.850651, 0.525731, 0] c1 [1, 0, 0] c2 [0.809017, 0.309017, -0.5]
3 z->center [0.939124, -0.294748, -0.176549] z->axis0 [0.299452, 0.954111, 0] z->axis1 [0.168448, -0.052868, 0.984292] star_position_scale 0.361541 c0 [1, 0, 0] c1 [0.850651, -0.525731, 0] c2 [0.809017, -0.309017, -0.5]
4 z->center [0.75696, 0, -0.653462] z->axis0 [0, 1, 0] z->axis1 [0.653462, 0, 0.75696] star_position_scale 0.361541 c0 [0.809017, 0.309017, -0.5] c1 [0.809017, -0.309017, -0.5] c2 [0.525731, 0, -0.850651]
5 z->center [0.934172, 0, -0.356822] z->axis0 [0, 1, 0] z->axis1 [0.356822, 0, 0.934172] star_position_scale 0.381966 c0 [0.809017, -0.309017, -0.5] c1 [0.809017, 0.309017, -0.5] c2 [1, 0, 0]
checkAndLoadCatal visitTriangles 2
6 z->center [0.934172, 0, 0.356822] z->axis0 [0, 1, 0] z->axis1 [-0.356822, 0, 0.934172] star_position_scale 0.763932 c0 [0.850651, -0.525731, 0] c1 [0.850651, 0.525731, 0] c2 [0.525731, 0, 0.850651]
7 z->center [0.939124, -0.294748, 0.176549] z->axis0 [0.299452, 0.954111, 0] z->axis1 [-0.168448, 0.052868, 0.984292] star_position_scale 0.381966 c0 [0.850651, -0.525731, 0] c1 [1, 0, 0] c2 [0.809017, -0.309017, 0.5]
8 z->center [0.939124, 0.294748, 0.176549] z->axis0 [-0.299452, 0.954111, 0] z->axis1 [-0.168448, -0.052868, 0.984292] star_position_scale 0.381966 c0 [1, 0, 0] c1 [0.850651, 0.525731, 0] c2 [0.809017, 0.309017, 0.5]
9 z->center [0.75696, 0, 0.653462] z->axis0 [0, 1, 0] z->axis1 [-0.653462, 0, 0.75696] star_position_scale 0.381966 c0 [0.809017, -0.309017, 0.5] c1 [0.809017, 0.309017, 0.5] c2 [0.525731, 0, 0.850651]
10 z->center [0.934172, 0, 0.356822] z->axis0 [0, 1, 0] z->axis1 [-0.356822, 0, 0.934172] star_position_scale 0.381966 c0 [0.809017, 0.309017, 0.5] c1 [0.809017, -0.309017, 0.5] c2 [1, 0, 0]
checkAndLoadCatal visitTriangles 3
11 z->center [0.57735, -0.57735, 0.57735] z->axis0 [0.707107, 0.707107, 0] z->axis1 [-0.408248, 0.408248, 0.816497] star_position_scale 0.763932 c0 [0.850651, -0.525731, 0] c1 [0.525731, 0, 0.850651] c2 [0, -0.850651, 0.525731]
12 z->center [0.762575, -0.580411, 0.285662] z->axis0 [0.605648, 0.795733, 0] z->axis1 [-0.227311, 0.173011, 0.95833] star_position_scale 0.381966 c0 [0.850651, -0.525731, 0] c1 [0.809017, -0.309017, 0.5] c2 [0.5, -0.809017, 0.309017]
13 z->center [0.580411, -0.285662, 0.762575] z->axis0 [0.441587, 0.897219, 0] z->axis1 [-0.684196, 0.336743, 0.6469] star_position_scale 0.381966 c0 [0.809017, -0.309017, 0.5] c1 [0.525731, 0, 0.850651] c2 [0.309017, -0.5, 0.809017]
14 z->center [0.285662, -0.762575, 0.580411] z->axis0 [0.936452, 0.350797, 0] z->axis1 [-0.203606, 0.543526, 0.814324] star_position_scale 0.381966 c0 [0.5, -0.809017, 0.309017] c1 [0.309017, -0.5, 0.809017] c2 [0, -0.850651, 0.525731]
15 z->center [0.57735, -0.57735, 0.57735] z->axis0 [0.707107, 0.707107, 0] z->axis1 [-0.408248, 0.408248, 0.816497] star_position_scale 0.381966 c0 [0.309017, -0.5, 0.809017] c1 [0.5, -0.809017, 0.309017] c2 [0.809017, -0.309017, 0.5]
checkAndLoadCatal visitTriangles 4
16 z->center [0, -0.356822, 0.934172] z->axis0 [1, 0, 0] z->axis1 [0, 0.934172, 0.356822] star_position_scale 0.763932 c0 [0.525731, 0, 0.850651] c1 [-0.525731, 0, 0.850651] c2 [0, -0.850651, 0.525731]
17 z->center [0.294748, -0.176549, 0.939124] z->axis0 [0.513854, 0.857878, 0] z->axis1 [-0.805654, 0.482573, 0.343578] star_position_scale 0.381966 c0 [0.525731, 0, 0.850651] c1 [0, 0, 1] c2 [0.309017, -0.5, 0.809017]
18 z->center [-0.294748, -0.176549, 0.939124] z->axis0 [0.513854, -0.857878, 0] z->axis1 [0.805654, 0.482573, 0.343578] star_position_scale 0.381966 c0 [0, 0, 1] c1 [-0.525731, 0, 0.850651] c2 [-0.309017, -0.5, 0.809017]
19 z->center [0, -0.653462, 0.75696] z->axis0 [1, 0, 0] z->axis1 [0, 0.75696, 0.653462] star_position_scale 0.381966 c0 [0.309017, -0.5, 0.809017] c1 [-0.309017, -0.5, 0.809017] c2 [0, -0.850651, 0.525731]
20 z->center [0, -0.356822, 0.934172] z->axis0 [1, 0, 0] z->axis1 [0, 0.934172, 0.356822] star_position_scale 0.381966 c0 [-0.309017, -0.5, 0.809017] c1 [0.309017, -0.5, 0.809017] c2 [0, 0, 1]
checkAndLoadCatal visitTriangles 5
21 z->center [0.57735, -0.57735, -0.57735] z->axis0 [0.707107, 0.707107, 0] z->axis1 [0.408248, -0.408248, 0.816497] star_position_scale 0.763932 c0 [0.850651, -0.525731, 0] c1 [0, -0.850651, -0.525731] c2 [0.525731, 0, -0.850651]
22 z->center [0.762575, -0.580411, -0.285662] z->axis0 [0.605648, 0.795733, 0] z->axis1 [0.227311, -0.173011, 0.95833] star_position_scale 0.381966 c0 [0.850651, -0.525731, 0] c1 [0.5, -0.809017, -0.309017] c2 [0.809017, -0.309017, -0.5]
23 z->center [0.285662, -0.762575, -0.580411] z->axis0 [0.936452, 0.350797, 0] z->axis1 [0.203606, -0.543526, 0.814324] star_position_scale 0.381966 c0 [0.5, -0.809017, -0.309017] c1 [0, -0.850651, -0.525731] c2 [0.309017, -0.5, -0.809017]
24 z->center [0.580411, -0.285662, -0.762575] z->axis0 [0.441587, 0.897219, 0] z->axis1 [0.684196, -0.336743, 0.6469] star_position_scale 0.381966 c0 [0.809017, -0.309017, -0.5] c1 [0.309017, -0.5, -0.809017] c2 [0.525731, 0, -0.850651]
25 z->center [0.57735, -0.57735, -0.57735] z->axis0 [0.707107, 0.707107, 0] z->axis1 [0.408248, -0.408248, 0.816497] star_position_scale 0.381966 c0 [0.309017, -0.5, -0.809017] c1 [0.809017, -0.309017, -0.5] c2 [0.5, -0.809017, -0.309017]
checkAndLoadCatal visitTriangles 6
26 z->center [0.356822, -0.934172, 0] z->axis0 [0.934172, 0.356822, 0] z->axis1 [0, 0, 1] star_position_scale 0.763932 c0 [0, -0.850651, 0.525731] c1 [0, -0.850651, -0.525731] c2 [0.850651, -0.525731, 0]
27 z->center [0.176549, -0.939124, 0.294748] z->axis0 [0.982784, 0.184757, 0] z->axis1 [-0.0544568, 0.289674, 0.955575] star_position_scale 0.381966 c0 [0, -0.850651, 0.525731] c1 [0, -1, 0] c2 [0.5, -0.809017, 0.309017]
28 z->center [0.176549, -0.939124, -0.294748] z->axis0 [0.982784, 0.184757, 0] z->axis1 [0.0544568, -0.289674, 0.955575] star_position_scale 0.381966 c0 [0, -1, 0] c1 [0, -0.850651, -0.525731] c2 [0.5, -0.809017, -0.309017]
29 z->center [0.653462, -0.75696, 0] z->axis0 [0.75696, 0.653462, 0] z->axis1 [0, 0, 1] star_position_scale 0.381966 c0 [0.5, -0.809017, 0.309017] c1 [0.5, -0.809017, -0.309017] c2 [0.850651, -0.525731, 0]
30 z->center [0.356822, -0.934172, 0] z->axis0 [0.934172, 0.356822, 0] z->axis1 [0, 0, 1] star_position_scale 0.381966 c0 [0.5, -0.809017, -0.309017] c1 [0.5, -0.809017, 0.309017] c2 [0, -1, 0]
checkAndLoadCatal visitTriangles 7
31 z->center [-0.356822, -0.934172, 0] z->axis0 [0.934172, -0.356822, 0] z->axis1 [0, 0, 1] star_position_scale 0.763932 c0 [0, -0.850651, -0.525731] c1 [0, -0.850651, 0.525731] c2 [-0.850651, -0.525731, 0]
32 z->center [-0.176549, -0.939124, -0.294748] z->axis0 [0.982784, -0.184757, 0] z->axis1 [-0.0544568, -0.289674, 0.955575] star_position_scale 0.381966 c0 [0, -0.850651, -0.525731] c1 [0, -1, 0] c2 [-0.5, -0.809017, -0.309017]
33 z->center [-0.176549, -0.939124, 0.294748] z->axis0 [0.982784, -0.184757, 0] z->axis1 [0.0544568, 0.289674, 0.955575] star_position_scale 0.381966 c0 [0, -1, 0] c1 [0, -0.850651, 0.525731] c2 [-0.5, -0.809017, 0.309017]
34 z->center [-0.653462, -0.75696, 0] z->axis0 [0.75696, -0.653462, 0] z->axis1 [0, 0, 1] star_position_scale 0.381966 c0 [-0.5, -0.809017, -0.309017] c1 [-0.5, -0.809017, 0.309017] c2 [-0.850651, -0.525731, 0]
35 z->center [-0.356822, -0.934172, 0] z->axis0 [0.934172, -0.356822, 0] z->axis1 [0, 0, 1] star_position_scale 0.381966 c0 [-0.5, -0.809017, 0.309017] c1 [-0.5, -0.809017, -0.309017] c2 [0, -1, 0]
checkAndLoadCatal visitTriangles 8
36 z->center [-0.57735, -0.57735, 0.57735] z->axis0 [0.707107, -0.707107, 0] z->axis1 [0.408248, 0.408248, 0.816497] star_position_scale 0.763932 c0 [0, -0.850651, 0.525731] c1 [-0.525731, 0, 0.850651] c2 [-0.850651, -0.525731, 0]
37 z->center [-0.285662, -0.762575, 0.580411] z->axis0 [0.936452, -0.350797, 0] z->axis1 [0.203606, 0.543526, 0.814324] star_position_scale 0.381966 c0 [0, -0.850651, 0.525731] c1 [-0.309017, -0.5, 0.809017] c2 [-0.5, -0.809017, 0.309017]
38 z->center [-0.580411, -0.285662, 0.762575] z->axis0 [0.441587, -0.897219, 0] z->axis1 [0.684196, 0.336743, 0.6469] star_position_scale 0.381966 c0 [-0.309017, -0.5, 0.809017] c1 [-0.525731, 0, 0.850651] c2 [-0.809017, -0.309017, 0.5]
39 z->center [-0.762575, -0.580411, 0.285662] z->axis0 [0.605648, -0.795733, 0] z->axis1 [0.227311, 0.173011, 0.95833] star_position_scale 0.381966 c0 [-0.5, -0.809017, 0.309017] c1 [-0.809017, -0.309017, 0.5] c2 [-0.850651, -0.525731, 0]
40 z->center [-0.57735, -0.57735, 0.57735] z->axis0 [0.707107, -0.707107, 0] z->axis1 [0.408248, 0.408248, 0.816497] star_position_scale 0.381966 c0 [-0.809017, -0.309017, 0.5] c1 [-0.5, -0.809017, 0.309017] c2 [-0.309017, -0.5, 0.809017]
checkAndLoadCatal visitTriangles 9
41 z->center [0, -0.356822, -0.934172] z->axis0 [1, 0, 0] z->axis1 [0, -0.934172, 0.356822] star_position_scale 0.763932 c0 [-0.525731, 0, -0.850651] c1 [0.525731, 0, -0.850651] c2 [0, -0.850651, -0.525731]
42 z->center [-0.294748, -0.176549, -0.939124] z->axis0 [0.513854, -0.857878, 0] z->axis1 [-0.805654, -0.482573, 0.343578] star_position_scale 0.381966 c0 [-0.525731, 0, -0.850651] c1 [0, 0, -1] c2 [-0.309017, -0.5, -0.809017]
43 z->center [0.294748, -0.176549, -0.939124] z->axis0 [0.513854, 0.857878, 0] z->axis1 [0.805654, -0.482573, 0.343578] star_position_scale 0.381966 c0 [0, 0, -1] c1 [0.525731, 0, -0.850651] c2 [0.309017, -0.5, -0.809017]
44 z->center [0, -0.653462, -0.75696] z->axis0 [1, 0, 0] z->axis1 [0, -0.75696, 0.653462] star_position_scale 0.381966 c0 [-0.309017, -0.5, -0.809017] c1 [0.309017, -0.5, -0.809017] c2 [0, -0.850651, -0.525731]
45 z->center [0, -0.356822, -0.934172] z->axis0 [1, 0, 0] z->axis1 [0, -0.934172, 0.356822] star_position_scale 0.381966 c0 [0.309017, -0.5, -0.809017] c1 [-0.309017, -0.5, -0.809017] c2 [0, 0, -1]
checkAndLoadCatal visitTriangles 10
46 z->center [-0.57735, -0.57735, -0.57735] z->axis0 [0.707107, -0.707107, 0] z->axis1 [-0.408248, -0.408248, 0.816497] star_position_scale 0.763932 c0 [0, -0.850651, -0.525731] c1 [-0.850651, -0.525731, 0] c2 [-0.525731, 0, -0.850651]
47 z->center [-0.285662, -0.762575, -0.580411] z->axis0 [0.936452, -0.350797, 0] z->axis1 [-0.203606, -0.543526, 0.814324] star_position_scale 0.381966 c0 [0, -0.850651, -0.525731] c1 [-0.5, -0.809017, -0.309017] c2 [-0.309017, -0.5, -0.809017]
48 z->center [-0.762575, -0.580411, -0.285662] z->axis0 [0.605648, -0.795733, 0] z->axis1 [-0.227311, -0.173011, 0.95833] star_position_scale 0.381966 c0 [-0.5, -0.809017, -0.309017] c1 [-0.850651, -0.525731, 0] c2 [-0.809017, -0.309017, -0.5]
49 z->center [-0.580411, -0.285662, -0.762575] z->axis0 [0.441587, -0.897219, 0] z->axis1 [-0.684196, -0.336743, 0.6469] star_position_scale 0.381966 c0 [-0.309017, -0.5, -0.809017] c1 [-0.809017, -0.309017, -0.5] c2 [-0.525731, 0, -0.850651]
50 z->center [-0.57735, -0.57735, -0.57735] z->axis0 [0.707107, -0.707107, 0] z->axis1 [-0.408248, -0.408248, 0.816497] star_position_scale 0.381966 c0 [-0.809017, -0.309017, -0.5] c1 [-0.309017, -0.5, -0.809017] c2 [-0.5, -0.809017, -0.309017]
checkAndLoadCatal visitTriangles 11
51 z->center [-0.934172, 0, -0.356822] z->axis0 [0, -1, 0] z->axis1 [-0.356822, 0, 0.934172] star_position_scale 0.763932 c0 [-0.850651, -0.525731, 0] c1 [-0.850651, 0.525731, 0] c2 [-0.525731, 0, -0.850651]
52 z->center [-0.939124, -0.294748, -0.176549] z->axis0 [0.299452, -0.954111, 0] z->axis1 [-0.168448, -0.052868, 0.984292] star_position_scale 0.381966 c0 [-0.850651, -0.525731, 0] c1 [-1, 0, 0] c2 [-0.809017, -0.309017, -0.5]
53 z->center [-0.939124, 0.294748, -0.176549] z->axis0 [-0.299452, -0.954111, 0] z->axis1 [-0.168448, 0.052868, 0.984292] star_position_scale 0.381966 c0 [-1, 0, 0] c1 [-0.850651, 0.525731, 0] c2 [-0.809017, 0.309017, -0.5]
54 z->center [-0.75696, 0, -0.653462] z->axis0 [0, -1, 0] z->axis1 [-0.653462, 0, 0.75696] star_position_scale 0.381966 c0 [-0.809017, -0.309017, -0.5] c1 [-0.809017, 0.309017, -0.5] c2 [-0.525731, 0, -0.850651]
55 z->center [-0.934172, 0, -0.356822] z->axis0 [0, -1, 0] z->axis1 [-0.356822, 0, 0.934172] star_position_scale 0.381966 c0 [-0.809017, 0.309017, -0.5] c1 [-0.809017, -0.309017, -0.5] c2 [-1, 0, 0]
checkAndLoadCatal visitTriangles 12
56 z->center [-0.934172, 0, 0.356822] z->axis0 [0, -1, 0] z->axis1 [0.356822, 0, 0.934172] star_position_scale 0.763932 c0 [-0.850651, 0.525731, 0] c1 [-0.850651, -0.525731, 0] c2 [-0.525731, 0, 0.850651]
57 z->center [-0.939124, 0.294748, 0.176549] z->axis0 [-0.299452, -0.954111, 0] z->axis1 [0.168448, -0.052868, 0.984292] star_position_scale 0.381966 c0 [-0.850651, 0.525731, 0] c1 [-1, 0, 0] c2 [-0.809017, 0.309017, 0.5]
58 z->center [-0.939124, -0.294748, 0.176549] z->axis0 [0.299452, -0.954111, 0] z->axis1 [0.168448, 0.052868, 0.984292] star_position_scale 0.381966 c0 [-1, 0, 0] c1 [-0.850651, -0.525731, 0] c2 [-0.809017, -0.309017, 0.5]
59 z->center [-0.75696, 0, 0.653462] z->axis0 [0, -1, 0] z->axis1 [0.653462, 0, 0.75696] star_position_scale 0.381966 c0 [-0.809017, 0.309017, 0.5] c1 [-0.809017, -0.309017, 0.5] c2 [-0.525731, 0, 0.850651]
60 z->center [-0.934172, 0, 0.356822] z->axis0 [0, -1, 0] z->axis1 [0.356822, 0, 0.934172] star_position_scale 0.381966 c0 [-0.809017, -0.309017, 0.5] c1 [-0.809017, 0.309017, 0.5] c2 [-1, 0, 0]
checkAndLoadCatal visitTriangles 13
61 z->center [0, 0.356822, -0.934172] z->axis0 [-1, 0, 0] z->axis1 [0, 0.934172, 0.356822] star_position_scale 0.763932 c0 [0.525731, 0, -0.850651] c1 [-0.525731, 0, -0.850651] c2 [0, 0.850651, -0.525731]
62 z->center [0.294748, 0.176549, -0.939124] z->axis0 [-0.513854, 0.857878, 0] z->axis1 [0.805654, 0.482573, 0.343578] star_position_scale 0.381966 c0 [0.525731, 0, -0.850651] c1 [0, 0, -1] c2 [0.309017, 0.5, -0.809017]
63 z->center [-0.294748, 0.176549, -0.939124] z->axis0 [-0.513854, -0.857878, 0] z->axis1 [-0.805654, 0.482573, 0.343578] star_position_scale 0.381966 c0 [0, 0, -1] c1 [-0.525731, 0, -0.850651] c2 [-0.309017, 0.5, -0.809017]
64 z->center [0, 0.653462, -0.75696] z->axis0 [-1, 0, 0] z->axis1 [0, 0.75696, 0.653462] star_position_scale 0.381966 c0 [0.309017, 0.5, -0.809017] c1 [-0.309017, 0.5, -0.809017] c2 [0, 0.850651, -0.525731]
65 z->center [0, 0.356822, -0.934172] z->axis0 [-1, 0, 0] z->axis1 [0, 0.934172, 0.356822] star_position_scale 0.381966 c0 [-0.309017, 0.5, -0.809017] c1 [0.309017, 0.5, -0.809017] c2 [0, 0, -1]
checkAndLoadCatal visitTriangles 14
66 z->center [-0.57735, 0.57735, -0.57735] z->axis0 [-0.707107, -0.707107, 0] z->axis1 [-0.408248, 0.408248, 0.816497] star_position_scale 0.763932 c0 [-0.850651, 0.525731, 0] c1 [0, 0.850651, -0.525731] c2 [-0.525731, 0, -0.850651]
67 z->center [-0.762575, 0.580411, -0.285662] z->axis0 [-0.605648, -0.795733, 0] z->axis1 [-0.227311, 0.173011, 0.95833] star_position_scale 0.381966 c0 [-0.850651, 0.525731, 0] c1 [-0.5, 0.809017, -0.309017] c2 [-0.809017, 0.309017, -0.5]
68 z->center [-0.285662, 0.762575, -0.580411] z->axis0 [-0.936452, -0.350797, 0] z->axis1 [-0.203606, 0.543526, 0.814324] star_position_scale 0.381966 c0 [-0.5, 0.809017, -0.309017] c1 [0, 0.850651, -0.525731] c2 [-0.309017, 0.5, -0.809017]
69 z->center [-0.580411, 0.285662, -0.762575] z->axis0 [-0.441587, -0.897219, 0] z->axis1 [-0.684196, 0.336743, 0.6469] star_position_scale 0.381966 c0 [-0.809017, 0.309017, -0.5] c1 [-0.309017, 0.5, -0.809017] c2 [-0.525731, 0, -0.850651]
70 z->center [-0.57735, 0.57735, -0.57735] z->axis0 [-0.707107, -0.707107, 0] z->axis1 [-0.408248, 0.408248, 0.816497] star_position_scale 0.381966 c0 [-0.309017, 0.5, -0.809017] c1 [-0.809017, 0.309017, -0.5] c2 [-0.5, 0.809017, -0.309017]
checkAndLoadCatal visitTriangles 15
71 z->center [-0.356822, 0.934172, 0] z->axis0 [-0.934172, -0.356822, 0] z->axis1 [0, 0, 1] star_position_scale 0.763932 c0 [0, 0.850651, 0.525731] c1 [0, 0.850651, -0.525731] c2 [-0.850651, 0.525731, 0]
72 z->center [-0.176549, 0.939124, 0.294748] z->axis0 [-0.982784, -0.184757, 0] z->axis1 [0.0544568, -0.289674, 0.955575] star_position_scale 0.381966 c0 [0, 0.850651, 0.525731] c1 [0, 1, 0] c2 [-0.5, 0.809017, 0.309017]
73 z->center [-0.176549, 0.939124, -0.294748] z->axis0 [-0.982784, -0.184757, 0] z->axis1 [-0.0544568, 0.289674, 0.955575] star_position_scale 0.381966 c0 [0, 1, 0] c1 [0, 0.850651, -0.525731] c2 [-0.5, 0.809017, -0.309017]
74 z->center [-0.653462, 0.75696, 0] z->axis0 [-0.75696, -0.653462, 0] z->axis1 [0, 0, 1] star_position_scale 0.381966 c0 [-0.5, 0.809017, 0.309017] c1 [-0.5, 0.809017, -0.309017] c2 [-0.850651, 0.525731, 0]
75 z->center [-0.356822, 0.934172, 0] z->axis0 [-0.934172, -0.356822, 0] z->axis1 [0, 0, 1] star_position_scale 0.381966 c0 [-0.5, 0.809017, -0.309017] c1 [-0.5, 0.809017, 0.309017] c2 [0, 1, 0]
checkAndLoadCatal visitTriangles 16
76 z->center [-0.57735, 0.57735, 0.57735] z->axis0 [-0.707107, -0.707107, 0] z->axis1 [0.408248, -0.408248, 0.816497] star_position_scale 0.763932 c0 [-0.850651, 0.525731, 0] c1 [-0.525731, 0, 0.850651] c2 [0, 0.850651, 0.525731]
77 z->center [-0.762575, 0.580411, 0.285662] z->axis0 [-0.605648, -0.795733, 0] z->axis1 [0.227311, -0.173011, 0.95833] star_position_scale 0.381966 c0 [-0.850651, 0.525731, 0] c1 [-0.809017, 0.309017, 0.5] c2 [-0.5, 0.809017, 0.309017]
78 z->center [-0.580411, 0.285662, 0.762575] z->axis0 [-0.441587, -0.897219, 0] z->axis1 [0.684196, -0.336743, 0.6469] star_position_scale 0.381966 c0 [-0.809017, 0.309017, 0.5] c1 [-0.525731, 0, 0.850651] c2 [-0.309017, 0.5, 0.809017]
79 z->center [-0.285662, 0.762575, 0.580411] z->axis0 [-0.936452, -0.350797, 0] z->axis1 [0.203606, -0.543526, 0.814324] star_position_scale 0.381966 c0 [-0.5, 0.809017, 0.309017] c1 [-0.309017, 0.5, 0.809017] c2 [0, 0.850651, 0.525731]
80 z->center [-0.57735, 0.57735, 0.57735] z->axis0 [-0.707107, -0.707107, 0] z->axis1 [0.408248, -0.408248, 0.816497] star_position_scale 0.381966 c0 [-0.309017, 0.5, 0.809017] c1 [-0.5, 0.809017, 0.309017] c2 [-0.809017, 0.309017, 0.5]
checkAndLoadCatal visitTriangles 17
81 z->center [0.57735, 0.57735, -0.57735] z->axis0 [-0.707107, 0.707107, 0] z->axis1 [0.408248, 0.408248, 0.816497] star_position_scale 0.763932 c0 [0, 0.850651, -0.525731] c1 [0.850651, 0.525731, 0] c2 [0.525731, 0, -0.850651]
82 z->center [0.285662, 0.762575, -0.580411] z->axis0 [-0.936452, 0.350797, 0] z->axis1 [0.203606, 0.543526, 0.814324] star_position_scale 0.381966 c0 [0, 0.850651, -0.525731] c1 [0.5, 0.809017, -0.309017] c2 [0.309017, 0.5, -0.809017]
83 z->center [0.762575, 0.580411, -0.285662] z->axis0 [-0.605648, 0.795733, 0] z->axis1 [0.227311, 0.173011, 0.95833] star_position_scale 0.381966 c0 [0.5, 0.809017, -0.309017] c1 [0.850651, 0.525731, 0] c2 [0.809017, 0.309017, -0.5]
84 z->center [0.580411, 0.285662, -0.762575] z->axis0 [-0.441587, 0.897219, 0] z->axis1 [0.684196, 0.336743, 0.6469] star_position_scale 0.381966 c0 [0.309017, 0.5, -0.809017] c1 [0.809017, 0.309017, -0.5] c2 [0.525731, 0, -0.850651]
85 z->center [0.57735, 0.57735, -0.57735] z->axis0 [-0.707107, 0.707107, 0] z->axis1 [0.408248, 0.408248, 0.816497] star_position_scale 0.381966 c0 [0.809017, 0.309017, -0.5] c1 [0.309017, 0.5, -0.809017] c2 [0.5, 0.809017, -0.309017]
checkAndLoadCatal visitTriangles 18
86 z->center [0.356822, 0.934172, 0] z->axis0 [-0.934172, 0.356822, 0] z->axis1 [0, 0, 1] star_position_scale 0.763932 c0 [0, 0.850651, -0.525731] c1 [0, 0.850651, 0.525731] c2 [0.850651, 0.525731, 0]
87 z->center [0.176549, 0.939124, -0.294748] z->axis0 [-0.982784, 0.184757, 0] z->axis1 [0.0544568, 0.289674, 0.955575] star_position_scale 0.381966 c0 [0, 0.850651, -0.525731] c1 [0, 1, 0] c2 [0.5, 0.809017, -0.309017]
88 z->center [0.176549, 0.939124, 0.294748] z->axis0 [-0.982784, 0.184757, 0] z->axis1 [-0.0544568, -0.289674, 0.955575] star_position_scale 0.381966 c0 [0, 1, 0] c1 [0, 0.850651, 0.525731] c2 [0.5, 0.809017, 0.309017]
89 z->center [0.653462, 0.75696, 0] z->axis0 [-0.75696, 0.653462, 0] z->axis1 [0, 0, 1] star_position_scale 0.381966 c0 [0.5, 0.809017, -0.309017] c1 [0.5, 0.809017, 0.309017] c2 [0.850651, 0.525731, 0]
90 z->center [0.356822, 0.934172, 0] z->axis0 [-0.934172, 0.356822, 0] z->axis1 [0, 0, 1] star_position_scale 0.381966 c0 [0.5, 0.809017, 0.309017] c1 [0.5, 0.809017, -0.309017] c2 [0, 1, 0]
checkAndLoadCatal visitTriangles 19
91 z->center [0.57735, 0.57735, 0.57735] z->axis0 [-0.707107, 0.707107, 0] z->axis1 [-0.408248, -0.408248, 0.816497] star_position_scale 0.763932 c0 [0, 0.850651, 0.525731] c1 [0.525731, 0, 0.850651] c2 [0.850651, 0.525731, 0]
92 z->center [0.285662, 0.762575, 0.580411] z->axis0 [-0.936452, 0.350797, 0] z->axis1 [-0.203606, -0.543526, 0.814324] star_position_scale 0.381966 c0 [0, 0.850651, 0.525731] c1 [0.309017, 0.5, 0.809017] c2 [0.5, 0.809017, 0.309017]
93 z->center [0.580411, 0.285662, 0.762575] z->axis0 [-0.441587, 0.897219, 0] z->axis1 [-0.684196, -0.336743, 0.6469] star_position_scale 0.381966 c0 [0.309017, 0.5, 0.809017] c1 [0.525731, 0, 0.850651] c2 [0.809017, 0.309017, 0.5]
94 z->center [0.762575, 0.580411, 0.285662] z->axis0 [-0.605648, 0.795733, 0] z->axis1 [-0.227311, -0.173011, 0.95833] star_position_scale 0.381966 c0 [0.5, 0.809017, 0.309017] c1 [0.809017, 0.309017, 0.5] c2 [0.850651, 0.525731, 0]
95 z->center [0.57735, 0.57735, 0.57735] z->axis0 [-0.707107, 0.707107, 0] z->axis1 [-0.408248, -0.408248, 0.816497] star_position_scale 0.381966 c0 [0.809017, 0.309017, 0.5] c1 [0.5, 0.809017, 0.309017] c2 [0.309017, 0.5, 0.809017]
checkAndLoadCatal visitTriangles 20
96 z->center [0, 0.356822, 0.934172] z->axis0 [-1, 0, 0] z->axis1 [0, -0.934172, 0.356822] star_position_scale 0.763932 c0 [-0.525731, 0, 0.850651] c1 [0.525731, 0, 0.850651] c2 [0, 0.850651, 0.525731]
97 z->center [-0.294748, 0.176549, 0.939124] z->axis0 [-0.513854, -0.857878, 0] z->axis1 [0.805654, -0.482573, 0.343578] star_position_scale 0.381966 c0 [-0.525731, 0, 0.850651] c1 [0, 0, 1] c2 [-0.309017, 0.5, 0.809017]
98 z->center [0.294748, 0.176549, 0.939124] z->axis0 [-0.513854, 0.857878, 0] z->axis1 [-0.805654, -0.482573, 0.343578] star_position_scale 0.381966 c0 [0, 0, 1] c1 [0.525731, 0, 0.850651] c2 [0.309017, 0.5, 0.809017]
99 z->center [0, 0.653462, 0.75696] z->axis0 [-1, 0, 0] z->axis1 [0, -0.75696, 0.653462] star_position_scale 0.381966 c0 [-0.309017, 0.5, 0.809017] c1 [0.309017, 0.5, 0.809017] c2 [0, 0.850651, 0.525731]
100 z->center [0, 0.356822, 0.934172] z->axis0 [-1, 0, 0] z->axis1 [0, -0.934172, 0.356822] star_position_scale 0.381966 c0 [0.309017, 0.5, 0.809017] c1 [-0.309017, 0.5, 0.809017] c2 [0, 0, 1]
重点结论:star_position_scale = 0.763932
mu0 = (A(11,:) - center(1,:)) * axis0.'; |
梳理好顺序之后,可以进入ZoneArray::initTriangle中进行查看,尝试第一个中点和轴的信息。
% plot_triangle.m |
// Initialize star_position_scale. This scale is used to multiply stars position
// encoded as integers so that it optimize precision over the triangle.
// It has to be computed for each triangle because the relative orientation of the 2 axis is different for each triangle.
// 初始化star_position_scale。 此比例用于乘以星星位置
// 编码为整数,以便优化三角形的精度。
// 必须为每个三角形计算它,因为每个三角形的 2 轴的相对方向不同。
MaxPosVal 2147483647=0x7fff ffff
20个大三角形 star_position_scale = 0.763932
80个小三角形 star_position_scale 0.381966
在ZoneArray.cpp中 查看变量 star_position_scale
mag_min 这一层中星等的下界。单位:millimag(10−3)。对最亮的恒星可能是负的。-2000 和 6000
mag_range 这一层星等的范围,都为12.8星等。单位:millimags
mag_steps 用于描述mag_range中的值的步骤数都为256 。总是正的。单个恒星的mag条目从0..mag_steps开始 256 12800/256=50 .每次移动 一步0.05mags,可以看到软件中最低分辨率为0.05星等。最多256步。
arg(level=0和1).arg(type=0).arg(major=0).arg(minor=8) |
class HipZoneArray : public SpecialZoneArray<Star1> |
在该函数中,可以得到star.hpp中的信息
_______________ |
点鼠标一下,这是可以触发的函数。
StelObjectMgr::cleverFind
StarMgr::searchAround 指向 放大倍率
SpecialZoneArray< Star>::searchAround
s->getJ2000Pos(z, static_cast< float>(movementFactor), tmp);
注意到只有这里一次调用了星表里的26785=4979+21806个数据。
StarMgr::loadData
z->updateHipIndex(hipIndex);
HipZoneArray::updateHipIndex
因此在ZoneArray.cpp中仿写saveHipIndex函数为
void HipZoneArray::saveHipIndex(HipIndexStruct hipIndex[]) const { |
保存文件的代码:
void HipZoneArray::saveHipIndex(HipIndexStruct hipIndex[]) const { |
在StarMgr.cpp的StarMgr::searchAround中添加
qDebug() << "searchAround" << ++bbbb << vv << limFov; |
clear all;close all;clc;
tic
A = importdata("catalog.txt");
hip = A(:,2);
x0 = A(:,3);
x1 = A(:,4);
dx0 = A(:,5);
dx1 = A(:,6);
bv = A(:,7);
mag = A(:,8);
plx = A(:,9);
spInt = A(:,10);
bvIndex = A(:,11);
hasName = A(:,12);
xyz = A(:,13:15);
level = A(:,16);
getNrOfStars = A(:,17);
star_position_scale = A(:,18);
mag_true = mag .* 0.05 + 6;
b = asind(xyz(:,3));
a = acosd(xyz(:,1)./sqrt(1-xyz(:,3).^2));
for i=1:length(b)
if(xyz(i,2)<0)
a(i,:)=360-a(i,:);
end
if(level(i)==0)
mag_true(i) = -2 + mag(i) * 0.05;
end
end
hh1 = (a./15);
hh = fix(hh1);
mm1 = (a./15 - hh)*60;
mm = fix(mm1);
ss = (mm1 - mm)*60;
al_hh = fix(b);
al_mm1 = (abs(b)-abs(al_hh))*60;
al_mm = fix(al_mm1);
al_ss = (al_mm1 - al_mm)*60;
A=[A,a,b,hh,mm,ss,al_hh,al_mm,al_ss,mag_true];
xlswrite('catal',A);
toc
clear all;close all;clc; |
getJ2000Pos 函数
getJ2000EquatorialPos (StarWrapper.hpp)
只有StarWrapper.cpp 和 ZoneArray.cpp 包含 #include “StarWrapper.hpp”
ZoneArray.cpp
StarMgr.hpp
class StelRegionObject //抽象基类 |
验证从二进制文件到赤经赤纬
qDebug() << "checkAndLoadCatalogcheckAndLoadCatalog" << ++aa << s->getHip() << " " << s->getX0() << " " << s->getX1() << " " << s->getDx0() << " " << s->getDx1() << " " << s->getBV() << " " << s->getMag() << " " << s->getPlx() << " " << s->getSpInt() << " " << s->getBVIndex() << " " << s->hasName() << " " << tmp << " " << level << " " << z->getNrOfStars() << " " << star_position_scale << movementFactor << core->getJDE() << "\n"; |
验证最后一个星
s->getJ2000Pos(z, static_cast<float>(movementFactor), tmp); |
进入函数
pos = (z->center) + (getX0())+movementFactorgetDx0()) (z->axis0) + (getX1())+movementFactorgetDx1()) (z->axis1);
(-623411838+ans*(-37) )* [-5.32625e-11, 1.69705e-10, 0]+(-188238807+ans*(-2097))*[2.99612e-11, 9.40346e-12, 1.75073e-10]+[0.939124, 0.294748, -0.176549] |
movementFactor = (M_PI / 180.) (0.0001 / 3600.) ((core->getJDE() - d2000) / 365.25) /(star_position_scale);
core->getJDE() = 2459656
d2000 = 2451545.0 截止2022.3.17 差距8111天
3.14159265358979323846 / 180.0 * 0.0001/3600.0*8111/365.25/60.5274 |
最终得到包含赤经赤纬星等的表