When can you use the law of sines and cosines?