Transform a position (and optionally velocity) vector from RSW to IJK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(3) | :: | rt_ijk |
Target IJK absolute position vector [km] |
|
real(kind=wp), | intent(in), | dimension(3) | :: | vt_ijk |
Target IJK absolute position vector [km] |
|
real(kind=wp), | intent(in), | dimension(3) | :: | dr_rsw |
Chaser RSW position vector [km] |
|
real(kind=wp), | intent(in), | dimension(3) | :: | dv_rsw |
Chaser RSW velocity vector [km/s] |
|
real(kind=wp), | intent(out), | dimension(3) | :: | r_ijk |
Chaser IJK absolute position vector [km] |
|
real(kind=wp), | intent(out), | optional, | dimension(3) | :: | v_ijk |
Chaser IJK absolute velocity vector [km/s] |
subroutine from_rsw_to_ijk_rv(rt_ijk,vt_ijk,dr_rsw,dv_rsw,r_ijk,v_ijk) implicit none real(wp),dimension(3),intent(in) :: rt_ijk !! Target IJK absolute position vector [km] real(wp),dimension(3),intent(in) :: vt_ijk !! Target IJK absolute position vector [km] real(wp),dimension(3),intent(in) :: dr_rsw !! Chaser RSW position vector [km] real(wp),dimension(3),intent(in) :: dv_rsw !! Chaser RSW velocity vector [km/s] real(wp),dimension(3),intent(out) :: r_ijk !! Chaser IJK absolute position vector [km] real(wp),dimension(3),intent(out),optional :: v_ijk !! Chaser IJK absolute velocity vector [km/s] real(wp),dimension(3,3) :: c real(wp),dimension(3,3) :: cdot if (present(v_ijk)) then call from_rsw_to_ijk(rt_ijk,vt_ijk,c=c,cdot=cdot) r_ijk = rt_ijk + matmul( c, dr_rsw ) v_ijk = vt_ijk + matmul( cdot, dr_rsw ) + matmul( c, dv_rsw ) else call from_rsw_to_ijk(rt_ijk,vt_ijk,c=c) r_ijk = rt_ijk + matmul( c, dr_rsw ) end if end subroutine from_rsw_to_ijk_rv