Source: http://pierrelux.net/documents/cours/4/pythagore_cosinus.PDF.pdf