Transform a position (and optionally velocity) vector from IJK to LVLH.
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) | :: | r_ijk |
Chaser IJK absolute position vector [km] |
|
real(kind=wp), | intent(in), | dimension(3) | :: | v_ijk |
Chaser IJK absolute position vector [km] |
|
real(kind=wp), | intent(out), | dimension(3) | :: | dr_lvlh |
Chaser LVLH position vector relative to target [km] |
|
real(kind=wp), | intent(out), | optional, | dimension(3) | :: | dv_lvlh |
Chaser LVLH position vector relative to target [km] |
subroutine from_ijk_to_lvlh_rv(rt_ijk,vt_ijk,r_ijk,v_ijk,dr_lvlh,dv_lvlh) 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) :: r_ijk !! Chaser IJK absolute position vector [km] real(wp),dimension(3),intent(in) :: v_ijk !! Chaser IJK absolute position vector [km] real(wp),dimension(3),intent(out) :: dr_lvlh !! Chaser LVLH position vector relative to target [km] real(wp),dimension(3),intent(out),optional :: dv_lvlh !! Chaser LVLH position vector relative to target [km] real(wp),dimension(3,3) :: c real(wp),dimension(3,3) :: cdot real(wp),dimension(3) :: dr_ijk, dv_ijk !IJK state of chaser relative to target: dr_ijk = r_ijk - rt_ijk ! [target + delta = chaser] if (present(dv_lvlh)) then dv_ijk = v_ijk - vt_ijk ! [target + delta = chaser] call from_ijk_to_lvlh(rt_ijk,vt_ijk,c=c,cdot=cdot) dr_lvlh = matmul( c, dr_ijk ) dv_lvlh = matmul( cdot, dr_ijk ) + matmul( c, dv_ijk ) else call from_ijk_to_lvlh(r_ijk,v_ijk,c=c) dr_lvlh = matmul( c, dr_ijk ) end if end subroutine from_ijk_to_lvlh_rv