parameters: (direction: numpy.ndarray)
return_statement: return M
docstring: Return matrix to translate by direction vector.
  
      >>> v = numpy.random.random(3) - 0.5
      >>> numpy.allclose(v, translation_matrix(v)[:3, 3])
      True
docstring_summary: Return matrix to translate by direction vector.
docstring_tokens: Return matrix to translate by direction vector .
function: def translation_matrix(direction: numpy.ndarray) -> numpy.ndarray:
      """Return matrix to translate by direction vector.
  
      >>> v = numpy.random.random(3) - 0.5
      >>> numpy.allclose(v, translation_matrix(v)[:3, 3])
      True
  
      """
      M = numpy.identity(4)
      M[:3, 3] = direction[:3]
      return M
function_tokens: def translation_matrix ( direction : numpy . ndarray ) -> numpy . ndarray : M = numpy . identity ( 4 ) M [ : 3 , 3 ] = direction [ : 3 ] return M