Calculating values of trigonometric functions