💾 Archived View for thrig.me › blog › 2024 › 05 › 05 › orbit.gmi captured on 2024-05-26 at 14:46:40. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-05-10)
-=-=-=-=-=-=-
10 PRINT "SOMEWHERE ABOVE YOUR PLANET IS A ROMULAN SHIP." 15 PRINT 20 PRINT "THE SHIP IS IN A CONSTANT POLAR ORBIT. ITS" 25 PRINT "DISTANCE FROM THE CENTER OF YOUR PLANET IS FROM" 30 PRINT "10,000 TO 30,000 MILES AND AT ITS PRESENT VELOCITY CAN" 31 PRINT "CIRCLE YOUR PLANET ONCE EVERY 12 TO 36 HOURS." 35 PRINT 40 PRINT "UNFORTUNATELY, THEY ARE USING A CLOAKING DEVICE SO" 45 PRINT "YOU ARE UNABLE TO SEE THEM, BUT WITH A SPECIAL" 50 PRINT "INSTRUMENT YOU CAN TELL HOW NEAR THEIR SHIP YOUR" 55 PRINT "PHOTON BOMB EXPLODED. YOU HAVE SEVEN HOURS UNTIL THEY" 60 PRINT "HAVE BUILT UP SUFFICIENT POWER IN ORDER TO ESCAPE" 65 PRINT "YOUR PLANET'S GRAVITY." 70 PRINT 75 PRINT "YOUR PLANET HAS ENOUGH POWER TO FIRE ONE BOMB AN HOUR." 80 PRINT 85 PRINT "AT THE BEGINNING OF EACH HOUR YOU WILL BE ASKED TO GIVE AN" 90 PRINT "ANGLE (BETWEEN 0 AND 360) AND A DISTANCE IN UNITS OF" 95 PRINT "100 MILES (BETWEEN 100 AND 300), AFTER WHICH YOUR BOMB'S" 100 PRINT "DISTANCE FROM THE ENEMY SHIP WILL BE GIVEN." 105 PRINT 110 PRINT "AN EXPLOSION WITHIN 5,000 MILES OF THE ROMULAN SHIP" 111 PRINT "WILL DESTROY IT." ... 198 PRINT "ON THE ABOVE DIAGRAM, THE ROMULAN SHIP IS CIRCLING" 199 PRINT "COUNTERCLOCKWISE AROUND YOUR PLANET. DON'T FORGET THAT" 200 PRINT "WITHOUT SUFFICIENT POWER THE ROMULAN SHIP'S ALTITUDE" 210 PRINT "AND ORBITAL RATE WILL REMAIN CONSTANT." 220 PRINT 230 PRINT "GOOD LUCK. THE FEDERATION IS COUNTING ON YOU." 270 A=INT(360*RND(1)) 280 D=INT(200*RND(1)+200) 290 R=INT(20*RND(1)+10)
One problem here is that being in orbit means the orbital velocity is a function of altitude (and the mass of the planet), and lower orbits move at higher velocities. Non-standard velocity? Energy would need to be expended to maintain that, and yet somehow this ship is stuck in (a probably fake) orbit for want of energy?
Another problem is that space is big and stuff takes a while to go places, even if you assume the planet has a lower escape velocity than Earth has. Therefore we must have some sort of teleporting photonic bomb that (more or less) instantly detonates at the target. Maybe the mass of the planet varies each game, thus explaining the variable orbit of the attacker?
As with films, computer games may involve "shut up and enjoy your Romulan attack bird scenario".
The game is fairly easy to brute force (there may be a more clever math solution maybe involving systems of equations, but it's been a long time since I did any serious algebra or geometry) given the limited number of angles, altitudes, and distances involved.
This is hour 1, at what angle do you wish to send do you wish to send your photon bomb? 158 How far out do you wish to detonate it? 298 Your photon bomb exploded 276*10^2 miles from the Romulan ship. This is hour 2, at what angle do you wish to send do you wish to send your photon bomb? 234 How far out do you wish to detonate it? 269 Your photon bomb exploded 52*10^2 miles from the Romulan ship. This is hour 3, at what angle do you wish to send do you wish to send your photon bomb? 257 How far out do you wish to detonate it? 321 Your photon bomb exploded 22*10^2 miles from the Romulan ship. You have successfully completed your mission.
Elsewhere,
$ perl bruteorb.pl try 158 298 $ perl bruteorb.pl 158,298,276 try 234 269 $ perl bruteorb.pl 158,298,276 234,269,52 253 320 261 320 255 321 257 321 259 321 262 226
was lucky in that the second shot was very close. The script given no inputs gives a random angle and distance to try. With a single input each potential angle (0..359) and potential distance (200..400) is checked for a distance match. One of these (plus a random velocity) is picked at random as a second target. With two or more inputs the subsequent shots are checked to see at what velocity (10..30) the additional shots fit what is known, which restricts the search space a lot.
Additional improvements could be made by accounting for the bomb radius when selecting where to fire, and anything else that I did not think of. In 1000 trials the above brute force usually one takes three (44.9% of trials) or four (38.4%) attempts to shoot down the bird; one trial took five attempts. I'm not going to share bruteorb.pl, so you'll have to write your own, if interested.
odds attempts necessary to hit the target 0.017 1 0.149 2 0.449 3 0.384 4 0.001 5
If you have a planet, figuring out its mass and other planetary facts would be pretty important, especially if there are hostiles in need of being shot at in orbit, or for various other less warlike purposes. On the other hand, too much stuff shot at in orbit may lead to the Kessler Syndrome.
The Kessler syndrome, proposed by NASA scientist Donald J. Kessler in 1978, is a scenario in which the density of objects in low Earth orbit due to space pollution is numerous enough that collisions between objects could cause a cascade in which each collision generates space debris that increases the likelihood of further collisions.