Map the Debris... WTF?

Map the Debris... WTF?


I’m sorry to use (or imply) such strong language, but I’m honestly at a loss. I’m guessing the creator of this challenge is a physics enthusiast. I don’t understand the question or the Wikipedia article, both of which I’ve read multiple times. I am smart enough to look for a formula to use, and there are two formulas in the Wikipedia article that we can use to determine the orbital period, but we don’t have all the required bits of information to use the formula.

We are provided with the average altitude as an argument to the function and we are also provided with the radius and GM value of the Earth.

  • We aren’t provided with the orbit’s semi-major axis in meters.
  • We aren’t provided with the mean density (of the Earth?).

So, I feel my frustration is justified.

I know that there’s an answer in the Wiki and I also noticed that there’s a video to watch somewhere else here in the forum, I also suspect that a person with some understanding of physics could glean the necessary information from the combination of the challenge description and the Wikipedia article.

What’s going on here? This doesn’t look like a programming challenge, but a physics challenge. If it’s a matter of implementing a formula, why don’t they provide the formula and identify the parts of it?

A challenge which is literally impossible for me to solve without looking at the solution ahead of time isn’t a useful educational device or an effective testing device.

Please, someone tell me that I’ve missed some important detail that makes this possible without simply copying and pasting the solution.

Thank you.



Hi, I agree that it would be better to give the formula in the challenge itself. Anyway the formula is T = 2*pi*sqrt(r^3/GM) where r = earthRadius+avgAlt, which is the distance from midpoint of the earth to the object, and T = Orbital Period

Feedback for the "Map the Debris" challenge

Thank you very much. I’m most concerned about that r. I read the same formula in the wiki, but it didn’t provide an explanation there, either. I want to know how you arrived at the definition of r.

We get the radius of the Earth in the question and the average altitude is one of values in the array that’s passed to the function as an argument, but how did you know to put them together?

I’m finally getting that an axis is a distance. For some reason, I was thinking that it was related to a direction in some way.

I think I have enough information to finish the challenge now and I really appreciate that. I hope to never see another question like this again.


Well r is the distance between the two objects (“r is the orbit’s semi-major axis in meters”). Since gravity works on the middle of the objects (and because the radius of the earth is given…), you have to add the radius to the average altitude.

I don’t recall any :slight_smile:


I wrote a blog post on map the debris a while back. Maybe it can help… .


Thank you jer244. I saw your article posted in another thread (the one with the video I think). I skimmed it, but it was focused on the Javascript that I don’t find difficult. The formula you used looked (at first glance) like it didn’t match the one at Wikipedia although I realize now that it’s just because you used a instead of r.

For some reason, I seem to always have the most difficulty with the things that everyone else finds to be the easiest.

The thing that helped me to understand the best was this line from BenGitter:

Since gravity works on the middle of the objects (and because the radius of the earth is given…), you have to add the radius to the average altitude.

In retrospect, I think I may have overreacted a little bit. The Wikipedia article still makes no sense to me and neither did that video from the other thread, but I can understand adding the radius of the earth to the altitude of the satellite to get the distance.

Thank you.



I would like to second your frustration. I actually think a lot of the challenges are needlessly nerdy, in the sense that understanding the question / problem is way more difficult than the actual coding that is necessary to solve it. Nothing wrong with nerdy in itself of course but in this case it is very counter-productive.



I know this is from last year but I was thinking the same thing!

I went to the WIKI and the formula was not the same. It just drove me crazy. I looked at the hints and it gave me the formula, but I feel like that should have been given.

I do not work in the developing field yet, however I think that info would not be for you to figure out. I feel like if you worked at say NASA as a developer, the scientist would come say I need the computer to do this (x, y, z) and you would ask how to get that. I am assuming they would possibly tell you. Just like this case. "Hey I need the computer to calculate “orbital periods”, and you would go, “how do I get that?”, they then tell you. (Unless you were the developer and scientist).

So I completely understand your frustration. I was very annoyed with this algorithm when I first started and it took me 5 mins once I had the formula. And the worst part is I’m a nerd, I use to be president of Astronomy club and vp of the Chemistry club back when I was in school, and also took all these extra science classes that I didn’t have to because I liked it.

I just feel like I was losing so much time trying to find out the little things and not actually coding.

I love FCC, but dang all these algorithms back to back was killing me lol.


Thank you for that article. Was a life saver!


I think standard deviation would have been easier but also somewhat challenging. Astronomy is a little too hard.