Derivation Of The Law Of Cosines And Its Application