What formula are we supposed to use to find the orbital period for this? I don’t get that.
Your code so far
function orbitalPeriod(arr) {
let GM = 398600.4418;
let earthRadius = 6367.4447;
return arr;
}
orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36 Edg/84.0.522.40
.
Challenge: Map the Debris
Link to the challenge:
1 Like
You should use the formula in the linked Wikipedia article under the section Two Bodies Orbiting Each Other.
I had to look at the solution provided by the site so I could see how to properly use the formula. But I got it.
Why is the section that says – “The formula needed is:” – just empty?
** EDIT **
For anyone who sucks at math and just needs the formula and stumbles upon this post!
let a = 2 * Math.PI;
let c = Math.pow(earthRadius + obj.avgAlt, 3);
let b = Math.sqrt(c / GM);
let orbPeriod = Math.round(a * b);
1 Like
Thanks for letting me know about the broken image. I’ve updated the guide.
1 Like
Nice! Thanks man and sorry for not blurring that out
So I wasn’t misunderstanding. There really was a problem with the image in that guide.
Thanks for the fix.
1 Like