30 years ago (pre-internet, pre-smart phones) I wrote a very simple numerical 2D orbital simulation program. I calculated the velocity and acceleration separately for the x and y components.
The massive body was at the origin (0,0). I picked an arbitrary iteration interval (10 seconds of flight time).
I fed in a starting position and a starting velocity. For instance, a position in Km (0,7000) and scalar velocity (7.8,0) in Km/sec. This would be an object in LEO travelling parallel to the x-axis.
Next, calculate the gravitational acceleration separately for each axis. For the first 10 sec iteration cycle, there would be no acceleration in the x-axis, but for the y-axis it would be 10 sec*9.8m/sec^2. Calculate the delta-v (0,-98) and the resulting velocity (7.8, -0.098). Update position (78,6922).
Update the display. Repeat the loop. Calculations are all arithmetic, using similar triangles. No trig or vector operations needed.
For LEO you can leave acceleration constant. For higher orbits, adjust acceleration for increasing radius using the (x,y) position.
This simplistic program produced very nice elliptical orbits and Hohmann transfers. An “Earth orbit” took about 10 seconds of processor time, running on an i386.
I could hit “pause”, insert a delta-v, then resume to see the result develop.
This programming approach works for 3 Body problems as well, but I gave up trying to achieve lunar transfers.
If you wish to save data (say, phase angle at apogee or velocity at perigee) it needs a few more programming lines.
To answer your question of how to find the position of apogee and perigee, you plug in your current position and velocity and hit the start button.
I extend a pre-emptive apology to all the real mathematicians and programmers out there for this kindergarten approach and the inevitable mistakes I have made dredging it from my memory.