We are given the radius of the moon, r = 408 km.
The problem states that the satellite is in elliptical orbit around the moon. The ellipse equation is:
[(x – h)^2 / a^2] + [(y – k)^2 / b^2] = 1
where,
h and k are the center point coordinates
a = length of semi major axis and (assuming horizontal ellipse)
b = length of semi minor axis
Assuming that the center of the moon is at one focus. Also assuming that the vertex is at the origin and the coordinates are (0,0). Therefore the equation becomes:
[x^2 / a^2] + [y ^2 / b^2] = 1
In this case
a = 408 km + 781 km = 1189 km.
b = 408 km + 562 km = 970 km.
Substitute the values of a and b into the equation:
[x^2 / 1189^2] + [y ^2 / 970^2] = 1 (horizontal ellipse)
This is the final equation for horizontal ellipse.
Now if the ellipse is vertical, simply swap the values of a and b.
[x^2 / 970^2] + [y ^2 / 1189^2] = 1 (vertical ellipse)