# How to calculate this angle?

• Jan 18th 2010, 11:51 AM
gtzpower
How to calculate this angle?
Hello all. I am working on a game, and I have a situation where I need to calculate an angle, but I have no idea where to start :) So I will try to illustrate the problem for you (literally).

http://www.spudgames.com/stuff/joint...alculation.jpg
The B and D arm can both rotate at the red circles (joints), and this in turn allows the C arm to move up and down. A is static, and cannot move. I need to be able to calculate the angle at joint 2 (between C and D) when joint 2 is moved up and down.

Anyone have any thoughts on how I would do this?

Thanks!

• Jan 18th 2010, 03:00 PM
skeeter
Quote:

Originally Posted by gtzpower
Hello all. I am working on a game, and I have a situation where I need to calculate an angle, but I have no idea where to start :) So I will try to illustrate the problem for you (literally).

http://www.spudgames.com/stuff/joint...alculation.jpg
The B and D arm can both rotate at the red circles (joints), and this in turn allows the C arm to move up and down. A is static, and cannot move. I need to be able to calculate the angle at joint 2 (between C and D) when joint 2 is moved up and down.

Anyone have any thoughts on how I would do this?

Thanks!

let $\displaystyle \theta$ = angle at (2)
$\displaystyle x$ = length from pivot (1) to the opposite vertex of the quadrilateral
$\displaystyle \theta = \arccos\left(\frac{C^2+D^2-x^2}{2CD}\right)$