The cosine function was originally created as a "make work" project for medieval tutors, to convince patrons that the tutors knew something exotic that was worth paying for; in this, the trig functions replaced the earlier Latin Squares Mysteries Strategic Work Initiative.
Later, cosine functions were found to have some useful mathematical properties.