from_lvlh_to_rsw_rv Subroutine

private subroutine from_lvlh_to_rsw_rv(dr_lvlh, dv_lvlh, dr_rsw, dv_rsw)

Transform a position (and optionally velocity) vector from LVLH to RSW.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: dr_lvlh

Chaser LVLH position vector relative to target [km]

real(kind=wp), intent(in), dimension(3) :: dv_lvlh

Chaser LVLH position vector relative to target [km]

real(kind=wp), intent(out), dimension(3) :: dr_rsw

Chaser RSW position vector relative to target [km]

real(kind=wp), intent(out), optional, dimension(3) :: dv_rsw

Chaser RSW velocity vector relative to target [km/s]


Called by

proc~~from_lvlh_to_rsw_rv~~CalledByGraph proc~from_lvlh_to_rsw_rv relative_motion_module::from_lvlh_to_rsw_rv interface~from_lvlh_to_rsw relative_motion_module::from_lvlh_to_rsw interface~from_lvlh_to_rsw->proc~from_lvlh_to_rsw_rv

Source Code

    subroutine from_lvlh_to_rsw_rv(dr_lvlh,dv_lvlh,dr_rsw,dv_rsw)

    implicit none

    real(wp),dimension(3),intent(in)           :: dr_lvlh !! Chaser LVLH position vector relative to target [km]
    real(wp),dimension(3),intent(in)           :: dv_lvlh !! Chaser LVLH position vector relative to target [km]
    real(wp),dimension(3),intent(out)          :: dr_rsw  !! Chaser RSW position vector relative to target [km]
    real(wp),dimension(3),intent(out),optional :: dv_rsw  !! Chaser RSW velocity vector relative to target [km/s]

    dr_rsw(2) =  dr_lvlh(1)
    dr_rsw(3) = -dr_lvlh(2)
    dr_rsw(1) = -dr_lvlh(3)

    if (present(dv_rsw)) then
        dv_rsw(2) =  dv_lvlh(1)
        dv_rsw(3) = -dv_lvlh(2)
        dv_rsw(1) = -dv_lvlh(3)
    end if

    end subroutine from_lvlh_to_rsw_rv