We make two calls to the https://api-ninjas.com/api/stars endpoint and store the result of each call in an Elixir agent. This includes the name, light years from earth, right ascension and declination of each star
We then use the input from your selected speed to calculate the distance between the two stars and return the result to you
We use trigonometry taking the light year distance between earth and each star, their right ascension and declination to calculate the distance between them. The trigonometry can be seen here