Determining signs and quadrants of trigonometric functions