Find the missing length of a triangle using the cosine function