matrix_from_frame

compas.geometry.matrix_from_frame(frame)[source]

Computes a change of basis transformation from world XY to the frame.

Parameters

frame (compas.geometry.Frame) – A frame describing the targeted Cartesian coordinate system

Returns

list of list of float – A 4x4 transformation matrix representing the transformation from world coordinates to frame coordinates.

Examples

>>> from compas.geometry import Frame
>>> f = Frame([1, 1, 1], [0.68, 0.68, 0.27], [-0.67, 0.73, -0.15])
>>> T = matrix_from_frame(f)