I'm writing a program that lets me animate the orbits of the planets in Matlab. This is working, but I would like to display the amount of times they fully went around the sun in a certain time lapse. I've been doing this by comparing the position they begin with with their current position: abs(current_position - begin_position < precision
.
But here's my problem: this precision is very different for each planet and their data. Like for Jupiter I have to set this precision to 0.2, while for Neptune it has to be 0.001, so I can't just say precision = 0.2
, because it generates faults with my other planets if I do so. Is there another way to compare these numbers or another way to achieve this? I've been trying to use angles also, but that didn't worked out quite well.
Thanks in advance.