The point at time t between points k and k2 (components from
sources): linear in time, within the two (time_fraction). Point k if
k2 isn't a point (beyond the ends, or more times than data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Trajectory), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | k |
a point (1 to num_points(sources)) |
||
| integer, | intent(in) | :: | k2 |
the other point (e.g. k + 1) |
||
| real(kind=wp), | intent(in) | :: | t |
the time |
||
| type(DataSource), | intent(in) | :: | sources(3) |
where the components come from |
pure function point_between(self, k, k2, t, sources) result(v) class(Trajectory), intent(in) :: self integer, intent(in) :: k !! a point (1 to num_points(sources)) integer, intent(in) :: k2 !! the other point (e.g. k + 1) real(wp), intent(in) :: t !! the time type(DataSource), intent(in) :: sources(3) !! where the components come from real(wp) :: v(3) v = self%point(k, sources) if (k2 < 1 .or. k2 > self%num_points(sources)) return v = v + self%time_fraction(k, k2, t) * (self%point(k2, sources) - v) end function point_between