Added a class version of the cosine function to permit pickling with the settings file save functionality