Calculating orbits using observational data How did astronomers in the 18th and 19th centuries used to calculate a comet's or planet's orbit using observational data, given that this data is relative to a non static reference point (i.e. the Earth)? 

For instance, here one can find the measurements of Mars' declination by Tycho Brahe throughout two decades. Not only it seems very difficult to me to deduce the right curve from the original observations points, but also the peaks of the curve (which resembles a sinusoid) do not seem perfectly equally distant from each other.
After researching a bit more, I think I can answer my own question (or at least share what I have found). When Kepler derived his laws using Tycho Brahe's observational data of Mars, he followed the procedure below:


first, the orbital period of Mars must be known. This value was already known in the time of Kepler (aprox. 687 days) $^1$, and can be derived as follows: first, one takes notes of the synodic period of Mars (which "[...] is the time that elapses between two successive conjunctions with the Sun–Earth line in the same linear order."$^2$). This can be done by calculating the elapsed time between two consecutive observations in which Mars is in the same apparent position in the sky. Then to calculate the orbital period of Mars, one can use:$\dfrac{1}{T_{M}} = \dfrac{1}{T_{E}} - \dfrac{1}{T_{M\mathrm{syn}}}$,$^3$ where $T_{M}$ is the orbital period of Mars, $T_{E}$ is the orbital period of Earth and $T_{M\mathrm{syn}}$ is the synodical period or Mars.
knowing the orbital period, Kepler then selected some of Brahe's observations that are exactly 687 days apart from each other (that is, one Martian year apart). This means that regardless of Mars relative position in the sky, the planet will be in the same position in relation to the Sun:





using triangulation, Kepler then calculated the distance of Mars to the Sun in terms of the distance of Earth to the Sun (1 AU). He did this for several positions of Mars.$^1$
while any three points define a circle, four or more do not necessarily do so. Kepler noticed that the collected data of distances between Mars and the Sun could be fit into an ellipse with the Sun in one of the focuses.