# Orientation Vector

An *orientation vector* specifies the orientation of an object in 3D space.
You use orientation vectors to specify relative orientations of components when using the Motion Service and Frame System.
The first three components of this vector form an axis pointing in the same direction as the object.
**Theta** specifies the angle of the object’s rotation about that axis.

## Example: A camera in a room

Imagine you have a room with a camera. The corner of the room is (0, 0, 0).

To configure the camera into the frame system, you need to know where in the room the camera is, and where it’s pointing.

**(OX, OY, OZ)** are defined by measurements starting from the corner of the room to the camera:

- Determine the position of the camera (3,5,2)
- Determine the position of a point that the camera can see, for example (3,1,1)
- Subtract the camera point from the observed point to get the OV of the camera: (3,1,1) - (3,5,2) = (0,-4,-1)

#### Note

When you provide an orientation vector to Viam, Viam normalizes it to the unit sphere. Therefore if you enter (0, -4, -1), Viam stores it internally and displays it to you as (0,-0.97, -0.24).

**Theta** describes the angle of rotation of the camera around the calculated vector.
If you are familiar with the pitch-roll-yaw system, you can think of theta as *roll*.
If your camera is perpendicular to one of the axes of your Frame system,
you can determine Theta by looking at the picture and changing the value to 0, 90, 180, or 270 until the orientation of the picture is correct.

OX, OY, OZ, and Theta together form the orientation vector which defines which direction the camera is pointing with respect to the corner of the room, as well as to what degree the camera is rotated about an axis through the center of its lens.

## Why Viam uses orientation vectors

- Easy to measure in the real world
- No protractor needed
- Rotation is pulled out as Theta which is often used independently and measured independently

Have questions, or want to meet other people working on robots? Join our Community Discord.

Was this page helpful?

Glad to hear it! If there is anything we could be doing better, please create an issue.

We're sorry about that. If you'd like to talk to us for help, please join the Community Discord. To ensure we know what's wrong with this page, you can also open an issue.