Frame.from_matrix
- classmethod Frame.from_matrix(matrix)
Construct a frame from a matrix.
- Parameters
matrix (list of list of float) – The 4x4 transformation matrix in row-major order.
- Returns
compas.geometry.Frame
– The constructed frame.
Examples
>>> from compas.geometry import matrix_from_euler_angles >>> ea1 = [0.5, 0.4, 0.8] >>> M = matrix_from_euler_angles(ea1) >>> f = Frame.from_matrix(M) >>> ea2 = f.euler_angles() >>> allclose(ea1, ea2) True