Moved trigonometric functions to their own file