matrix_from_basis_vectors

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

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

Parameters:
xaxis[float, float, float] | compas.geometry.Vector

The x-axis of the frame.

yaxis[float, float, float] | compas.geometry.Vector

The y-axis of the frame.

Returns:
list[list[float]]

A 4x4 transformation matrix representing a rotation.

Notes

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

Examples

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