Skip to content

Commit 665e61b

Browse files
committed
Working through the linear algebra
1 parent 7230db0 commit 665e61b

1 file changed

Lines changed: 50 additions & 6 deletions

File tree

todo.org

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,62 @@ $\mathbf{E} =
106106
defines coordinate system where the x-direction points toward (latitude,
107107
longitude) = (0, 0) and z-direction points to the north pole.
108108

109-
Takes $a,f$ (semi-major and inverse flattening), plus $\mathbf{n}_{EA}^{E}$ and $\mathbf{n}_{EB}^{E}$.
109+
$det(\mathbf{E}) = 1$
110+
110111
******** Step 2
111112

112-
First calculate $\mathbf{p}_{AB}^{E}=\mathbf{p}_{EB}^{E}-\mathbf{p}_{EA}^{E}$. They use $\mathbf{E}\cdot\mathbf{n}_{EB}^{E}$ to calculate $\mathbf{p}_{EB}^{E}$, scale it using equation 22 from Gade to get $\mathbf{p}_{EL}^{E}$ (coordiante system L, with same n-vector as B), but lies at the center of the Earth).
113+
$\mathbf{n}_{EA}^{E}\rightarrow\mathbf{p}_{EA}^{E}$
114+
115+
$\mathbf{n}_{EA}^{E}=\frac{1}{det(\mathbf{E})*\lvert\mathbf{n}_{EA}^{E}
116+
\rvert}\mathbf{E}\cdot\mathbf{n}_{EA}^{E}$
117+
118+
Note that both $\mathbf{E}$ and $\mathbf{n}_{EA}^{E}$ *are* normalized, I suspect
119+
the renormalization is for the sake of numerical stability.
120+
121+
$\mathbf{p}_{EL}^{E}=\frac{b}{\sqrt{(n_{x}^{E})^{2} +
122+
\frac{a^{2}}{b^{2}}(n_{y}^{E})^{2} +
123+
\frac{a^{2}}{b^{2}}(n_{z}^{E})^{2}}}\left[n_{x}^{E},\frac{a^{2}}{b^{2}}n_{y}^{E},\frac{a^{2}}{b^{2}}n_{z}^{E}\right]$
113124

114-
Then finish the rotation with
115-
$\mathbf{p}_{EB}^{E} = \mathbf{E}^{T}\cdot \mathbf{p}_{EL}^{E} - \mathbf{n}_{EB}^{E} * h)$ (depth is h in equation 22) (they use depth = 0 for each vector).
125+
$\mathbf{p}_{EA}^{E}=\mathbf{E}^{T}\cdot\left(\mathbf{p}_{EL}^{E} - h\mathbf{n}_{EA}^{E}\right)$ where $h$ is depth (below ellipsoid in meters).
126+
127+
Calculate $\mathbf{p}_{EA}^{E}$ and $\mathbf{p}_{EB}^{E}$
116128

117129
******** Step 3
118130

119-
Then Get $\mathbf{R}_{EN}$ (n_E2R_EN) (this function is the meat of the
120-
calculation it seems).
131+
$\mathbf{R}_{EN}$ from $\mathbf{n}_{EA}^{E}$ and $\mathbf{E}$:
132+
$\mathbf{n}_{EA}^{E}=\frac{1}{det(\mathbf{E})*\lvert\mathbf{n}_{EA}^{E}\rvert}\mathbf{E}\cdot\mathbf{n}_{EA}^{E}$ (result is a matrix)
133+
(renormalize for numerical stability)
134+
135+
New coordinate frame $N$, where the z-axis is north (instead of E [east])
136+
137+
$N_{z}^{E}=-\mathbf{n}_{EA}^{E}$ (points opposite direction of n-vector)
138+
139+
$N_{y}^{E} = \begin{pmatrix}1\\0\\0\end{pmatrix}\times\mathbf{n}_{EA}^{E}$ (find
140+
y-direction, (I think that this is the cross product with each column vector that forms $\mathbf{n}_{EA}^{E}$) equation 9) (points perpendicular
141+
to plane formed by n-vector and Earth's spin axis)
142+
143+
//
144+
Normalize (I can't tell if this is a vector of a matrix at the moment,
145+
everything /should/ be vectors, but their python code is very weird)
146+
//
147+
148+
$N_{y}^{E}=\frac{N_{y}^{E}}{\lvert N_{y}^{E}\rvert}$ normalize again
149+
150+
This doesn't make sense to me:
151+
$N_{y}^{E}[:, poles] = \begin{pmatrix}0\\1\\0\end{pmatrix}$ select y-axis direction
152+
153+
Find x-axis direction of N
154+
$N_{x}^{E} = N_{y}^{E}\times N_{z}^{E}$ just the right-hand rule (that is simple)
155+
156+
Then some more shenanigans
157+
$N_{xyz}^{E} = \left[N_{x}^{E}, N_{y}^{E}, N_{z}^{E}\right]$ where this is a full matrix (because each $N_{a}^{E}$ is a column vector)
158+
159+
*Note*
160+
161+
162+
$\mathbf{E}^{T} = \begin{pmatrix}0 & 0 & -1\\0 & 1 & 0\\1 & 0 & 0\end{pmatrix}$
163+
164+
$\mathbf{R}_{EN}=\mathbf{E}^{T}\cdot N_{x}^{E}\cdot N_{y}^{E}\cdot N_{z}^{E}$
121165

122166
******** Step 4
123167

0 commit comments

Comments
 (0)