Trigonometry with applications