matrix_from_basis_vectors

compas.geometry.matrix_from_basis_vectors(xaxis, yaxis)[source]

Creates a rotation matrix from basis vectors (= orthonormal vectors).

Parameters
  • xaxis (list of float) – The x-axis of the frame.

  • yaxis (list of float) – The y-axis of the frame.

Returns

list of list of float – A 4x4 transformation matrix representing a rotation.

Examples

>>> xaxis = [0.68, 0.68, 0.27]
>>> yaxis = [-0.67, 0.73, -0.15]
>>> R = matrix_from_basis_vectors(xaxis, yaxis)

Notes

[ x0  y0  z0  0 ]
[ x1  y1  z1  0 ]
[ x2  y2  z2  0 ]
[  0   0   0  1 ]