function orbitalPeriod(arr) {
var GM = 398600.4418;
var earthRadius = 6367.4447;
var semiMajorAxis= 1;
const result = 2 * Math.PI
const result1 = Math.round(Math.sqrt(Math.exp(semiMajorAxis,3)/GM));
console.log(result1)
return arr;
}

I believe I’ve found all the Math. functions in order to complete the challenge.
Please not above I am not trying yet to figure out how to sort through the array with object keys. I am only testing the math portion of the challenge.

So assuming 1 is the semi-major axis, this leads to my section question…

Why am I getting infinity as a result of the const result 1 portion of the calculation?

semi major axis is not one…
the object orbit at a certain altitude, but that is the distance of the object from earth surface, to get the semi major axis which is from the center of the earth you also need the earth radius

The average orbital altitude is the average height for the satellite above the surface of the Earth. This is almost the same thing as the semi-major axis.

You need to be doing the semi-major axis of the Earth-satellite system, not the Sun-Earth system. The semi-major axis of the Sun-Earth system is 1AU, but the semi-major axis of the Earth-satellite system depends upon the orbit of the satellite.

approximately you could say that the F1-c distance can rapresent the Earth radius, so then you need the altitude of whatever object you are making the calculation for - considering it is different objects you can’t take the semi-major axis as a fixed number but it is to be calculated for each different celestial body

(not true, those are the ellipse’s foci, but it to have a graphic rapresentation of why you need the earth radius)

I don’t think that’s quite right. The earth is at F1. The satellite is on the perimeter of the ellipse. The intuition in this is a bit hard because the connection between average altitude and the semi-major axis is not ‘clean’.

You want the average radius of the earth and the average orbital altitude. When you use those together, they approximate the semi-major axis of the object.

If one focus of the ellipse defining the orbit is at the center of the Earth and the average orbital altitude gives you the average distance between the satellite and the surface of the Earth then
______ + ______ = ______

Ok. So assuming I am drowning in a glass of water.

This should work at least for the first test but I am still getting infinity as a result.
I believe the problem lies inside “(Math.sqrt(Math.exp(a,3)/GM))”

function orbitalPeriod(arr) {
var GM = 398600.4418;
var earthRadius = 6367.4447;
var avgAlt = 35873.5553;
var a = avgAlt + earthRadius;
const result1 = Math.round(2 * Math.PI*(Math.sqrt(Math.exp(a,3)/GM)));
console.log(result1);
return arr;
}
orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);