The fraction of the way in time from point k to point k2 (any two points: e.g. k + 1, or k - 1 with times running backward) at time t, kept within 0 to 1 (0 if their times are the same). No checks: k and k2 must be times.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Trajectory), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | k |
the points (1 to num_times) |
||
| integer, | intent(in) | :: | k2 |
the points (1 to num_times) |
||
| real(kind=wp), | intent(in) | :: | t |
the time |
pure real(wp) function time_fraction(self, k, k2, t) result(frac) class(Trajectory), intent(in) :: self integer, intent(in) :: k, k2 !! the points (1 to num_times) real(wp), intent(in) :: t !! the time frac = 0.0_wp if (self%t(k2) /= self%t(k)) frac = max(0.0_wp, min(1.0_wp, (t - self%t(k)) / (self%t(k2) - self%t(k)))) end function time_fraction