Analytic Trigonometry with Applications