# 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!

if you know the lengths of D and C, and you also know the distance from pivot (1) to the opposite vertex of the quadrilateral, then you can use the law of cosines to find the angle at (2) ...

let $\theta$ = angle at (2)

$x$ = length from pivot (1) to the opposite vertex of the quadrilateral

$\theta = \arccos\left(\frac{C^2+D^2-x^2}{2CD}\right)$
• Jan 18th 2010, 05:02 PM
gtzpower
Thanks for the reply. I think I need to provide more info as I do not know the location of pivot 1. I know the length of all sides A, B, C, and D. I also know the angle between A and D, the bottom left pivot but thats all I know. I need to be able to predict the angle of pivot 2 when I change the angle between A and D.

Thanks again, and sorry about the lack of info. I'm not a math genious but I think all needed info is on the table now. (Wink)