Algorithm for three-dimensional conversion from orbital elements to position and velocity
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | gm |
grav. parameter [km^3/sec^2] |
||
real(kind=wp), | intent(in), | dimension(6) | :: | e |
[al, q, ei, bom, om, tau] |
|
real(kind=wp), | intent(out), | dimension(6) | :: | pv |
[x, y, z, xdot, ydot, zdot] |
pure subroutine els3pv (gm, e, pv) implicit none real(wp),intent(in) :: gm !! grav. parameter [km^3/sec^2] real(wp),dimension(6),intent(in) :: e !! [al, q, ei, bom, om, tau] real(wp),dimension(6),intent(out) :: pv !! [x, y, z, xdot, ydot, zdot] real(wp) :: x,y,z,xdot,ydot,zdot,al,q,ei,bom,om,tau real(wp) :: r,u,vr,vt,c,s,x1,x2,y1,y2 if (all(e==zero)) then pv = zero else al = e(1) q = e(2) ei = e(3) bom = e(4) om = e(5) tau = e(6) call els2pv (gm, al, q, om, tau, r, u, vr, vt) c = cos(u) s = sin(u) x1 = r*c y1 = r*s x2 = vr*c - vt*s y2 = vr*s + vt*c c = cos(ei) s = sin(ei) z = y1*s y1 = y1*c zdot = y2*s y2 = y2*c c = cos(bom) s = sin(bom) x = x1*c - y1*s y = x1*s + y1*c xdot = x2*c - y2*s ydot = x2*s + y2*c pv(1) = x pv(2) = y pv(3) = z pv(4) = xdot pv(5) = ydot pv(6) = zdot end if end subroutine els3pv