Use of cosine and sine laws