## 2019年11月12日火曜日

### 数学 - Python - 円の中にひそむ関数 - 三角関数 - 加法定理 - 正接の加法定理 - 直積的に計算

• $\begin{array}{l}\mathrm{tan}1{5}^{\circ }\\ =\mathrm{tan}\frac{15}{180}\pi \\ =\mathrm{tan}\frac{1}{12}\pi \\ =\mathrm{tan}\left(\frac{\pi }{4}-\frac{\pi }{6}\right)\\ =\frac{\mathrm{tan}\frac{\pi }{4}-\mathrm{tan}\frac{\pi }{6}}{1+\mathrm{tan}\frac{\pi }{4}\mathrm{tan}\frac{\pi }{6}}\\ =\frac{1-\frac{1}{\sqrt{3}}}{1+1·\frac{1}{\sqrt{3}}}\\ =\frac{\sqrt{3}-1}{\sqrt{3}+1}\\ =\frac{3-2\sqrt{3}+1}{2}\\ =2-\sqrt{3}\end{array}$

• $\begin{array}{l}\mathrm{tan}10{5}^{\circ }\\ =\mathrm{tan}\frac{105}{180}\pi \\ =\mathrm{tan}\frac{7}{12}\pi \\ =\mathrm{tan}\left(\frac{\pi }{4}+\frac{\pi }{3}\right)\\ =\frac{\mathrm{tan}\frac{\pi }{4}+\mathrm{tan}\frac{\pi }{3}}{1-\mathrm{tan}\frac{\pi }{4}\mathrm{tan}\frac{\pi }{3}}\\ =\frac{1+\sqrt{3}}{1-1·\sqrt{3}}\\ =\frac{1+\sqrt{3}}{1-\sqrt{3}}\\ =\frac{1+2\sqrt{3}+3}{-2}\\ =-2-\sqrt{3}\end{array}$

コード

#!/usr/bin/env python3
import math
from unittest import TestCase, main
from sympy import pprint, symbols, tan, sqrt

print('18.')

class MyTestCase(TestCase):

def test1(self):

def test2(self):

if __name__ == '__main__':
main()


% ./sample18.py -v
18.
test1 (__main__.MyTestCase) ... ok
test2 (__main__.MyTestCase) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.004s

OK
%