[FORTRAN] Determining Apoapsis + Periapsis (Astrophysics)

In summary, the conversation is discussing how to determine the apoapsis (or periapsis) of a point, given its coordinates on a graph with the focus point at P(0,0). The proposed method is to use the Pythagorean Theorem on each point to find the distance from the origin and then compare to find the point with the largest (or smallest) distance. The provided example program demonstrates this method. However, it is unclear if this is the desired solution or if it is an unfinished program.
  • #1
Nicolaus
73
0
Say the focus point - the Sun - is at P(0,0), would I then determine the apoapsis (periapsis) by implementing the Pythagorean Theorem on each point to determine which point's distance is largest (smallest for periapsis) from the origin, then output the coordinates for each? Each coordinate to be checked is extracted from an array.
Exampled program for computing apoapsis:
apo = 0
do i = 1, lengthAR
d = sqrt((xAR(i)**2) + (yAR(i)**2))
if (d .gt. apo) then
apo = d
x = xAR(i)
y = yAR(i)
end if
end do
print*, "Apoapsis = ", x, y
end
 
Technology news on Phys.org
  • #2
Your question doesn't seem to be programming related. On top of that, you seem to post the answer to your own question. Can you be a little bit more clear? Is that program what you're looking for or is it your own unfinished program?
 

What is FORTRAN?

FORTRAN (short for Formula Translation) is a high-level programming language commonly used for scientific and engineering calculations. It was developed in the 1950s and is still widely used today.

What is apoapsis and periapsis?

Apoapsis and periapsis are two terms used to describe the furthest (apoapsis) and closest (periapsis) points in an orbit around a celestial body, such as a planet or star.

How is apoapsis and periapsis determined in FORTRAN?

In FORTRAN, apoapsis and periapsis can be determined using the Kepler's laws of planetary motion. This involves calculating the semi-major axis of the orbit and using it to calculate the distances of apoapsis and periapsis. The equations used for this calculation can vary depending on the type of orbit (e.g. circular, elliptical, parabolic).

What data is needed to determine apoapsis and periapsis?

To determine apoapsis and periapsis, data such as the mass and position of the celestial body being orbited, the initial position and velocity of the orbiting object, and the time of observation are needed. This data can be obtained from astronomical observations or through simulations.

Why is determining apoapsis and periapsis important in astrophysics?

Determining apoapsis and periapsis is important in astrophysics because it allows scientists to accurately model and predict the motion of celestial bodies. This information is crucial for understanding the dynamics of our solar system and other planetary systems, as well as for space missions and satellite operations.

Similar threads

  • Programming and Computer Science
Replies
12
Views
959
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
22
Views
4K
  • Programming and Computer Science
Replies
2
Views
715
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
1
Views
945
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
12
Views
3K
  • Programming and Computer Science
Replies
1
Views
2K
Back
Top