I was under the impression that I need Px and Cx, as well as Py and Cy, to calculate the distance between the asteroid and the Earth. The distance between the asteroid and the Earth are needed to calculate the force exerted on the asteroid by the Earth? And with this force, which changes with...
I update the accelerations inside of each conditional statement depending on which quadrant I am in.
A1 = B;
A2 = pi - B;
A3 = B - pi;
A4 = (2 * pi) - B;
Depending on which quadrant I am in, I add or subtract 180 degrees or 360 degrees from the calculated angle B to adjust for my quadrant...
Hello and thanks for the reply. I think that early on in this project the idea of starting with a known angle and speed that would yield a stable orbit crossed my mind, but I quickly discarded the idea when I realized that I do not know how to calculate a stable orbit.
By setting Cy = 25e6 and...
I have made a couple changes to the code, which seem to have had a positive impact, but a stable orbit still eludes me.
I have replaced all instances of:
if(Cx < Px && Cy < Py)
{
Vcx += (ax * ts);
Vcy += (ay * ts);
}
else
{
Vcx = Vcx - (ax * ts);
Vcy = Vcy - (ay * ts);
}
with a...
The program begins by prompting the user to input the initial angle and speed. Once these values have been input, the program calculates the initial velocity components for the asteroid in two dimensions.
printf("Input an initial angle from 10 to 80 degrees\n");
scanf("%f", &theta)...