# Code-Based Positioning
Code Based Positioning is based on solving the geometric problem of using at least 4 pseudorange measurements from satellites,
resulting in

$$
R^j - D^j \simeq \sqrt{(x^j-x)^2 + (y^j-y)^2 + (z^j-z)^2} + c\delta t
$$
$$
j = 1,2,...,n (n\geq 4)
$$
It uses the continuosly broadcast signals by satellites to calculate time-of-flight to the receiver's position,
and then estimating the distance to each of them.
It is implemented as the standard positioning service.

# Phase-Based Positioning
If higher accuracy is needed, phase-based positioning is used, which is implemented in Precise Point Positioning (PPP).
It provides a significantly higher accuracy with centimetre-level positioning but incurs higher computational costs 
as more corrections have to be applied
and requires tracking continuity.
As the name suggests, both code and phase observations are used.

Code and carrier measuremens are modeled as:
$$
R^j_C = \rho^j + c(\delta t - \delta t^j) + Tr^j + M^j_C + \epsilon^j_C
$$
$$
\Phi^j_C = \rho^j + c(\delta t - \delta t^j) + Tr^j + \lambda^j_C + B^j_C + m^j_C +\epsilon^j_C
$$
Where $R^j$ is the unsmoothed pseudorange measurment for the $j$-th satellite and $\Phi^j$ is the corresponding carrier measurement.
