A Generalization Of Quaternions And Their Applications