Evaluating trigonometric functions and finding reference angles