
55Chapter 3: Inverse Kinematics for 2D Movement
Normally, when using sin, cos, or tan, you are
given some combination of one of the angles of
the triangle and a few of the sides. As we saw
in the previous example, with the use of arctan,
we can determine the value of an angle in the
triangle as long as we know the lengths of at
least two sides of the triangle. This can be useful,
but there’s a catch: This is true only with right
triangles, such as our lower triangle.
The upper triangle we’ve created is not a right
triangle. Thanks to the law of cosines, we can still
solve for the angles within the non–right triangle,
but in order to do so, we ...