Most Efficient way to solve for Euler Angles

1. Jun 23, 2011

Robconway

Essentially, a lazer is pointing at a certain point in 3 dimensional space. There is a fixed target that the lazer is specifically supposed to point to. My job is to find the most efficient way to solve for the euler angles(yaw pitch and roll) in order to sync the lazer with the target point. What is the best way to do this? The values known are the direct distance from the lazer to to the target, the distance from the lazer to the initial point, and the distance from the initial point to the fixed target. Thank you guys, it would help a lot!

2. Jun 23, 2011

obafgkmrns

You need more or different info. One set of info that would be sufficient is the cartesian coordinates of the initial point and the target with respect to the laser plus the yaw, pitch, and roll of the laser in that coordinate system. Another sufficient set is yaw, pitch, and roll of the laser plus the yaw and pitch of the target position with respect to some fixed coordinate system. It's not clear exactly what your particular situation is, but the info you've given is not sufficient to solve the problem.

3. Jun 24, 2011

HallsofIvy

Staff Emeritus
A vector pointing from $(x_0, y_0, z_0)$ to $(x_1, y_1, z_1)$ can be written as $\vec{v}= (x_1- x_0)\vec{i}+ (y_1- y_0)\vec{j}+ (z_1- z_0)\vec{j}$. Its length is
$$|\vec{v}|= r= \sqrt{(x_1-x_0)^2+ (y_1- y_0)^2+ (z_1- z_0)2}$$

Finally, the unit vector in that direction is
$$\frac{\vec{v}}{|\vec{v}|}= \frac{x_1- x_0}{r}\vec{i}+ \frac{y_1- y_0}{r}\vec{j}+ \frac{z_1- z_0}{r}\vec{k}$$

So the Euler angles are given by
$$cos(\theta_x)= \frac{x_1- x_0}{r}$$
$$cos(\theta_y)= \frac{y_1- y_0}{r}$$
$$cos(\theta_z)= \frac{z_1- z_0}{r}$$

That is, the Euler angles for a given direction are the arccosines of the components of a unit vector in that direction.