implement cot as tan(pi/2 - angle)