added law of cosines method to simplify angles code