# RotationMatrix2VR

Utility that transforms 3x3 rotation matrix into rotation axis-angle 4-vector

Utilities

## Description

A rotation with respect to an initial orientation has many equivalent representations. A common and important one is the 3-by-3 orthogonal rotation matrix R, where R-1 = RT and RTR = RRT = I, the 3-by-3 identity matrix. Another important representation is the combination of rotation axis (a unit vector `n`) and angle of rotation θ about that axis. The sign of rotation follows the right-hand-rule.

The RotationMatrix2VR block converts the 3-by-3 rotation matrix representation of orientation to its equivalent representation as a rotation axis and angle about that axis, the form used in Virtual Reality Modeling Language (VRML) for orienting bodies. The input and output signals are bundled Simulink® signals.

The most common use of rotations is to represent the orientation of a body with respect to some coordinate system (CS) axes.

## Dialog Box and Parameters

The dialog has no active areas.

### Representations of Rotation Signals

The rotation matrix R has the form:

$\left(\begin{array}{ccc}{R}_{11}& {R}_{12}& {R}_{13}\\ {R}_{21}& {R}_{22}& {R}_{23}\\ {R}_{31}& {R}_{32}& {R}_{33}\end{array}\right)$

The input signal to the RotationMatrix2VR block is the R matrix components passed column-wise and bundled into a single 9-component Simulink signal: ```[R11 R21 R31 R12 ...]```.

The output signal is the equivalent rotation represented as the axis of rotation, a unit vector n = (nx,ny,nz), with

n·n = nx2 + ny2 + nz2 = 1,

and the angle of rotation θ about that axis. The sign of the rotation follows the right-hand rule. The output signal is bundled into a single 4-component Simulink signal:

`[n`x` n`y` n`z` `θ`]`.

Body

See Representations of Body Motion and Representations of Body Orientation for more details on representing body rotations.

See entries on axis-angle rotation, Euler angles, quaternion, and rotation matrix in the Glossary for summaries of body orientation representations.

For more on virtual reality and VRML, see the 3D Animation™ User's Guide.