Points along a closed curve, as separate segments: pairs (p(i), p(i+1)).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | p(:,:) |
(3, n) points of the curve |
pure function closed_segments(p) result(s) real(wp), intent(in) :: p(:,:) !! (3, n) points of the curve real(wp) :: s(3, 2 * size(p, 2)) integer :: i, n n = size(p, 2) do i = 1, n s(:, 2*i-1) = p(:, i) s(:, 2*i) = p(:, modulo(i, n) + 1) end do end function closed_segments