from_rsw_to_lvlh_rv Subroutine

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

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

Arguments

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

Chaser RSW position vector relative to target [km]

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

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

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]


Called by

proc~~from_rsw_to_lvlh_rv~~CalledByGraph proc~from_rsw_to_lvlh_rv relative_motion_module::from_rsw_to_lvlh_rv interface~from_rsw_to_lvlh relative_motion_module::from_rsw_to_lvlh interface~from_rsw_to_lvlh->proc~from_rsw_to_lvlh_rv

Source Code

    subroutine from_rsw_to_lvlh_rv(dr_rsw,dv_rsw,dr_lvlh,dv_lvlh)

    implicit none

    real(wp),dimension(3),intent(in)           :: dr_rsw  !! Chaser RSW position vector relative to target [km]
    real(wp),dimension(3),intent(in)           :: dv_rsw  !! Chaser RSW velocity vector relative to target [km/s]
    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]

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

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

    end subroutine from_rsw_to_lvlh_rv