Returns the Translation matrix for a given vector translation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(vector), | intent(in) | :: | o |
Vector to translate by. |
function translate(o) result(out) !! Returns the Translation matrix for a given vector translation. !> Vector to translate by. type(vector), intent(IN) :: o real(kind=wp) :: out(4, 4) out(:, 1) = [1._wp, 0._wp, 0._wp, o%x] out(:, 2) = [0._wp, 1._wp, 0._wp, o%y] out(:, 3) = [0._wp, 0._wp, 1._wp, o%z] out(:, 4) = [0._wp, 0._wp, 0._wp, 1._wp] end function translate