Solving for unknown variables using trigonometric functions