## The cosine function

The cosine function is very similar to the sine function. It just uses different leg in it’s equation. Thus the definition is: For the angle *α*, the cosine function gives the ratio of the length of the adjacent side to the length of the hypotenuse. For our triangle, it holds:

As you can see, the cosine function just uses the adjacent side instead of opposite side in the formula. We can simply compute the length of the *AB* side using the same approach. We adjust the equation such that the only unknown variable *|AB|* is on the left side:

We can use the Google again to compute the value of *cos(30°)* and we see it’s equals to circa 0.866). Not a nice number like before but that’s life. We can substitute known values

This is good enough result, but we can do better. The value *cos(30°)* is actually a very known value since

Using this knowledge we can express the result more precisely as