For example, like if an asteroid was projected to pass Earth but not until 20 years from now, how do we calculate this? How is that even possible to know?
When there’s (basically) no air resistance like in outer space, you can use some relatively simple equations developed by Isaac Newton and Johannes Kepler back in the 16th/17th centuries to get how their orbits (position as a function of time) for basically forever, all you have to do then is set the ones for earth and the object equal to each other and solve for the time
Even if the equations get too complicated to solve with pen and paper you can just plug them into a computer and it’ll figure it out that way numerically
There are a couple of different ways. If you are talking about an asteroid the easiest thing is to just waatch it from multiple different points in space, which allows you to figure out its velocity even if it does happen to be coming directly for us. Although in your example it would be more a case of plotting the orbit that the object is taken, since 20 years means it is almost certainly going to go around the sun several times.
If you are talking about a star thousands or even millions of light years away, you can still determine whether it is moving towards us or away from us by using what is known as red shift or blue shift.
When an object is moving towards us any radiation it emits gets compressed, and if it is moving away then that radiation gets stretched. This results in the color of the star changing blue if it is coming towards us or red if it is going away.
And we can know what color the star is supposed to be by looking at the hydrogen emission lines. These are kind of like fingerprint lines in a star’s emission spectrum that always occur on very specific wavelengths. So if we see those lines and they are more red than they should be, then we know the star is moving away from us.
The Doppler effect but for light, if you’re familiar with the sound that a race car makes when it is approaching you, it gets louder and louder. Once it passes it stars tapering off and getting softer and softer.
With light there is a similar principle except that light from an object moving towards us will look more “blue” as the light waves compress. The opposite is true for objects that move further away from us as the wavelength of their light increases and thus become more “redder”. This phenomena is called blueshift in the former case and redshift in the latter case.
As a result scientists can use the light of an object to determine how far away it is by extrapolating data based on how shifted the light is. The more it has shifted to the blue spectrum, the closer it is to us. The further it has shifted to the red spectrum, the further away it is from us. For example, the furthest galaxies from Earth billions of light years away and require extremely sensitive telescopes that can detect light deep into the infrared range.
Prediction and probability are the main things used in determining the way objects move through our solar system. If we look up and see a “light” moving in contrary to the stillness of the stars, it most likely would be an object such as an asteroid or if it’s much bigger, a planet. If we can pinpoint where it is then, we can always just predict where it will be based on it’s movement in the sky. And further more we can predict based on gravity and how the object bends around the sun during it’s orbit then determine if it’s possible to hit earth, or a near miss hit to earth.
It’s the reason why Haley’s comet is so well documented, it passes near earth every 3/4 of a century. We know exactly where Haley’s comet will be in the next 10-15 passes, because it’s orbit has remained largely the same.
Since there’s not air to slow things down in space, they kind of just keep moving the same way (an object in motion stays in motion…). The only significant force acting on objects in deep space is gravity, so if you know where something is and what speed/direction its traveling, you can predict where it will be in the future pretty accurately.