 # Convert from unit vector to rotation angles

• Thank you very much for your help.

My question is:

With respect to the world frame, I have some coordinates (x,y,z) representing a position, as well as a unit vector (i,j,k) representing a certain orientation, but I need to convert the unit vector to rotation angles (rx,ry,rz in degrees) for the control of Epson / Fanuc robot arm. Just wondering if you know how to do the conversion?

• Perhaps I can write it more clearly:

In CAD model, the orientation can be represented by a unit vector (i,j,k) where i^2+j^2+k^2=1

In robot arm (e.g. Fanuc), the orientation can be represented by rotation angles (rx,ry,rz) where each variable ranges from -180 degrees to 180 degrees

The axis directions have been aligned with respect to the world frame: i is parallel to x, j to y, k to z. When (i,j,k) = (0,0,1) then (rx,ry,rz) = (0,0,0) which is pointing upwards (towards z).

Suppose we rotate around y-axis for 90 degrees, i.e. (rx,ry,rz) = (0,90,0), then (i,j,k) becomes (1,0,0) which is pointing towards x.

The question is, in general, how to convert (i,j,k) to (rx,ry,rz), and vice versa? Thank you very much indeed.

• This is an area I only know the broad outlines of, but I do know that a unit vector, by itself, contains insufficient information to convert into an Euler or Tait-Bryan orientation.

The issue is that a unit vector gives you an "arrow" in 3D space. It tells you which direction the arrow is pointing, but not how the arrow is rotated around its length. So you only have a partial definition of the arrow's orientation. An Euler or T-B orientation set requires a full definition.

You need enough information to create a Rotation Matrix, and use the correct matrix that matches the Euler Sequence for the robot you're using to convert between matrix and Euler.

• Hi SkyeFire,

Let's consider the backward conversion first, i.e. from (U,V,W) to (i,j,k). For example, Epson robot arm can be controlled with respect to the World Frame. Apart from (X,Y,Z), "you can jog U (Z axis rotation of the base coordinate system), V (Y axis rotation of the base coordinate system), and W (X axis rotation of the base coordinate system)". How to represent the resulting orientation as (i,j,k)?

Thanks again.

• if i,j,k are distances in X,Y,Z and i^2+j^2+k^2=1 than this is a standard Cartesian unit vector.

you can recover angles using geometry IF you know particular convention used for order of rotations and handedness of your coordinate system. you did not mention either of two so no math examples are possible.

reason:

translations are simple. also translation operations are commutative. (even if done in different order, you still get to same place, although using different path).

rotation operations are NOT commutative. so order does matter (if executed in wrong order you get to a different place).

here is a basic introduction to Euler angles:

good luck