Main Content

axang2tform

Convert axis-angle rotation to homogeneous transformation

Description

example

tform = axang2tform(axang) converts a rotation given in axis-angle form, axang, to a homogeneous transformation matrix, tform. When using the transformation matrix, premultiply it with the coordinates to be transformed (as opposed to postmultiplying).

Examples

collapse all

axang = [1 0 0 pi/2]; 
tform = axang2tform(axang)
tform = 4×4

    1.0000         0         0         0
         0    0.0000   -1.0000         0
         0    1.0000    0.0000         0
         0         0         0    1.0000

Input Arguments

collapse all

Rotation given in axis-angle form, specified as an n-by-4 matrix of n axis-angle rotations. The first three elements of every row specify the rotation axis, and the last element defines the rotation angle (in radians).

Example: [1 0 0 pi/2]

Output Arguments

collapse all

Homogeneous transformation matrix, specified by a 4-by-4-by-n matrix of n homogeneous transformations. When using the transformation matrix, premultiply it with the coordinates to be formed (as opposed to postmultiplying).

Example: [0 0 1 0; 0 1 0 0; -1 0 0 0; 0 0 0 1]

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also

Introduced in R2015a