Basic Rotations

RTSX Help: Basic Rotations

rotx, roty, rotz

trotx, troty, trotz

Basic rotation about coordinate axis X,Y, or Z

Syntax

  • [R] = rotx(theta)
  • [R] = roty(theta)    
  • [R] = rotz(theta)      
  • [T] = trotx(theta)      
  • [T] = troty(theta)      
  • [T] = trotz(theta)      

Input Arguments

  • theta —   rotation angle (default in radian. See options below)

Output Arguments

  • R — 3×3 rotation matrix
  • T — 4×4 homogeneous transformation matrix

Options

  • Put ‘deg’ as second argument to input angle value in degree. Ex. R=rotx(45, ‘deg’)

Description

Compute basic rotation around main coordinate axis X, Y, Z. The argument input value must is defaulted to radian. rotx(),roty(),rotz() returns a 3×3 basic rotation matrix R, while trotx(),troty(), trotz() returns a 4×4 homogeneous translation matrix T = [R d;0 0 0 1] with d = [0,0,0]’.

Examples

-->R=rotx(pi/2)
 R  =
 
    1.    0.    0.  
    0.    0.  - 1.  
    0.    1.    0.  
 
-->T=trotz(pi/4)
 T  =
 
    0.7071068  - 0.7071068    0.    0.  
    0.7071068    0.7071068    0.    0.  
    0.           0.           1.    0.  
    0.           0.           0.    1.

See Also