matrix_from_translation

compas.geometry.matrix_from_translation(translation)[source]

Returns a 4x4 translation matrix in row-major order.

Parameters

translation (list of float) – The x, y and z components of the translation.

Returns

list of list of float – The 4x4 transformation matrix representing a translation.

Examples

>>> T = matrix_from_translation([1, 2, 3])

Notes

[ .  .  .  0 ]
[ .  .  .  1 ]
[ .  .  .  2 ]
[ .  .  .  . ]