Main Content

vrrotvec2mat

(To be removed) Convert rotation from axis-angle to matrix representation

vrrotvec2mat will be removed in a future release. For more information, see Version History.

Syntax

m = vrrotvec2mat(r)
m = vrrotvec2mat(r,options)

Description

m = vrrotvec2mat(r) returns a matrix representation of the rotation defined by the axis-angle rotation vector, r.

m = vrrotvec2mat(r,options) returns a matrix representation of rotation defined by the axis-angle rotation vector r, with the default algorithm parameters replaced by values defined in options.

The options structure contains the parameter epsilon that represents the value below which a number will be treated as zero (default value is 1e-12).

The rotation vector, r, is a row vector of four elements, where the first three elements specify the rotation axis, and the last element defines the angle.

To rotate a column vector of three elements, multiply it by the rotation matrix. To rotate a row vector of three elements, multiply it by the transposed rotation matrix.

Version History

Introduced in R2007b

collapse all

R2023b: To be removed

The vrrotvec2mat function will be removed in a future release. Instead, use sim3d classes and Simulation 3D blocks in Unreal Engine Scenario Applications to interface MATLAB® and Simulink® with the Unreal Engine® 3D simulation environment. To get started, see Get Started Creating Virtual World with Actors.