Skip to content

Commit d25c76c

Browse files
committed
Update documentation to use katex formatting
1 parent 00a66de commit d25c76c

File tree

3 files changed

+38
-18
lines changed

3 files changed

+38
-18
lines changed

swiftnav/src/coords.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@
1717
//!
1818
//! --------
1919
//! Conversion from geodetic coordinates latitude, longitude and height
20-
//! (ϕ, λ, h) into Cartesian coordinates (X, Y, Z) can be
20+
//! ($\phi$, $\lambda$, $h$) into Cartesian coordinates ($X$, $Y$, $Z$) can be
2121
//! achieved with the following formulae:
22-
//! * X = (N(ϕ) + h) * cos(ϕ) * cos(λ)
23-
//! * Y = (N(ϕ) + h) * cos(ϕ) * sin(λ)
24-
//! * Z = [(1-e^2) * N(ϕ) + h] * sin(ϕ)
2522
//!
26-
//! Where the 'radius of curvature', N(ϕ), is defined as:
27-
//! * N(ϕ) = a / sqrt(1-e^2 / sin^2(ϕ))
23+
//! $$X = (N(\phi) + h) * cos(\phi) * cos(\lambda)$$
24+
//! $$Y = (N(\phi) + h) * cos(\phi) * sin(\lambda)$$
25+
//! $$Z = [(1-e^2) * N(\phi) + h] * sin(\phi)$$
2826
//!
29-
//! and `a` is the WGS84 semi-major axis and `e` is the WGS84
27+
//! Where the 'radius of curvature', $N(\phi)$, is defined as:
28+
//!
29+
//! $$N(\phi) = a / sqrt(1-e^2 / sin^2(\phi))$$
30+
//!
31+
//! and $a$ is the WGS84 semi-major axis and $e$ is the WGS84
3032
//! eccentricity.
3133
//!
3234
//! --------

swiftnav/src/edc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
/// This CRC is used with the RTCM protocol
1515
///
1616
/// The CRC polynomial used is:
17+
/// $$[
1718
/// x^{24} + x^{23} + x^{18} + x^{17} + x^{14} + x^{11} + x^{10} +
1819
/// x^7 + x^6 + x^5 + x^4 + x^3 + x+1
20+
/// ]$$
1921
///
2022
/// Mask 0x1864CFB, not reversed, not XOR'd
2123
pub fn compute_crc24q(buf: &[u8], initial_value: u32) -> u32 {

swiftnav/src/reference_frame/mod.rs

+27-11
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,34 @@ pub enum ReferenceFrame {
138138

139139
/// 15-parameter Helmert transformation parameters
140140
///
141-
/// This transformation consists of a 3 dimensional translation,
142-
/// 3 dimensional rotation, and a universal scaling. All terms,
143-
/// except for the reference epoch, have a an additional time
144-
/// dependent term. The rotations are typically very small, so
145-
/// the small angle approximation is used.
141+
/// This is an extention of the 7-parameter Helmert transformation
142+
/// where each term has an additional time-dependent term. This
143+
/// transformation consists of a 3 dimensional translation,
144+
/// 3 dimensional rotation, and a universal scaling. The tranformation
145+
/// takes the form of:
146146
///
147-
/// There are several sign and scale conventions in use with
148-
/// Helmert transformations. In this implementation we follow
149-
/// the IERS conventions, meaning the translations are in
150-
/// millimeters, the rotations are in milliarcseconds, and
151-
/// the scaling is in parts per billion. We also follow the
152-
/// IERS convention for the sign of the rotation terms.
147+
/// $$
148+
/// \begin{bmatrix} X \\\\ Y \\\\ Z \end{bmatrix}\_{REF2} =
149+
/// \begin{bmatrix} X \\\\ Y \\\\ Z \end{bmatrix}\_{REF1} +
150+
/// \begin{bmatrix} \bar{t}_x \\\\ \bar{t}_y \\\\ \bar{t}_z \end{bmatrix} +
151+
/// \begin{bmatrix} \bar{s} & -\bar{r}_z & \bar{r}_y \\\\
152+
/// \bar{r}_z & \bar{s} & -\bar{r}_x \\\\
153+
/// -\bar{r}_y & \bar{r}_x & \bar{s} \end{bmatrix}
154+
/// \begin{bmatrix} X \\\\ Y \\\\ Z \end{bmatrix}\_{REF1}
155+
/// $$
156+
///
157+
/// Where each $\bar{}$ parameter in the transformation is time
158+
/// dependent and is defined to be:
159+
///
160+
/// $$ \bar{p}(t) = p + \dot{p}(t - \tau) $$
161+
///
162+
/// Where $p$ is the constant value, $\dot{p}$ is the rate of
163+
/// change, and $\tau$ is the reference epoch.
164+
///
165+
/// There are several sign conventions in use for the rotation
166+
/// parameters in Helmert transformations. In this implementation
167+
/// we follow the IERS conventions, which is opposite of the original
168+
/// formulation of the Helmert transformation.
153169
#[derive(Debug, PartialEq, PartialOrd, Clone, Copy)]
154170
pub struct TimeDependentHelmertParams {
155171
tx: f64,

0 commit comments

Comments
 (0)