add_attitude Subroutine

private subroutine add_attitude(self, q, ok)

Add an attitude quaternion [x, y, z, w] for the next time that has none. ok is false if every time already has an attitude.

Type Bound

Trajectory

Arguments

Type IntentOptional Attributes Name
class(Trajectory), intent(inout) :: self
real(kind=wp), intent(in) :: q(4)

quaternion [x, y, z, w]

logical, intent(out), optional :: ok

false if not added


Calls

proc~~add_attitude~~CallsGraph proc~add_attitude Trajectory%add_attitude proc~grow_attitudes grow_attitudes proc~add_attitude->proc~grow_attitudes proc~new_capacity new_capacity proc~grow_attitudes->proc~new_capacity

Called by

proc~~add_attitude~~CalledByGraph proc~add_attitude Trajectory%add_attitude proc~add_point Trajectory%add_point proc~add_point->proc~add_attitude

Source Code

    subroutine add_attitude(self, q, ok)
        class(Trajectory), intent(inout) :: self
        real(wp), intent(in) :: q(4)            !! quaternion [x, y, z, w]
        logical, intent(out), optional :: ok    !! false if not added
        if (present(ok)) ok = .false.
        if (self%n_att >= self%n_times) return
        call grow_attitudes(self, self%n_att + 1)
        self%n_att = self%n_att + 1
        self%att(:, self%n_att) = q
        self%revision_ = self%revision_ + 1
        if (present(ok)) ok = .true.
    end subroutine add_attitude