## 2019年12月8日日曜日

### 数学 - Python - 円の中にひそむ関数 - 三角関数 - 加法定理 - 三角関数の諸公式 - 正弦と余弦、等式の証明、和と差の変形

1. $\begin{array}{l}\mathrm{sin}7{0}^{\circ }-\mathrm{sin}5{0}^{\circ }\\ =\mathrm{sin}\left(6{0}^{\circ }+1{0}^{\circ }\right)-\mathrm{sin}\left(6{0}^{\circ }-1{0}^{\circ }\right)\\ =\mathrm{sin}6{0}^{\circ }\mathrm{cos}1{0}^{\circ }+\mathrm{cos}6{0}^{\circ }\mathrm{sin}1{0}^{\circ }\\ -\left(\mathrm{sin}6{0}^{\circ }\mathrm{cos}1{0}^{\circ }-\mathrm{cos}6{0}^{\circ }\mathrm{sin}1{0}^{\circ }\right)\\ =2\mathrm{cos}6{0}^{\circ }\mathrm{sin}1{0}^{\circ }\\ =2·\frac{1}{2}\mathrm{sin}1{0}^{\circ }\\ =\mathrm{sin}1{0}^{\circ }\end{array}$

2. $\begin{array}{l}\mathrm{cos}7{0}^{\circ }+\mathrm{cos}5{0}^{\circ }\\ =\mathrm{cos}\left(6{0}^{\circ }+1{0}^{\circ }\right)+\mathrm{cos}\left(6{0}^{\circ }-1{0}^{\circ }\right)\\ =2·\frac{1}{2}\mathrm{cos}1{0}^{\circ }\\ =\mathrm{cos}1{0}^{\circ }\end{array}$

3. $\begin{array}{l}\mathrm{sin}4{0}^{\circ }-\mathrm{sin}8{0}^{\circ }+\mathrm{sin}16{0}^{\circ }\\ =\mathrm{sin}\left(6{0}^{\circ }-2{0}^{\circ }\right)-\mathrm{sin}\left(6{0}^{\circ }+2{0}^{\circ }\right)+\mathrm{sin}16{0}^{\circ }\\ =-2\mathrm{cos}6{0}^{\circ }\mathrm{sin}2{0}^{\circ }+\mathrm{sin}16{0}^{\circ }\\ =-\mathrm{sin}2{0}^{\circ }+\mathrm{sin}16{0}^{\circ }\\ =-\mathrm{sin}\left(9{0}^{\circ }-7{0}^{\circ }\right)+\mathrm{sin}\left(9{0}^{\circ }+7{0}^{\circ }\right)\\ =2\mathrm{cos}9{0}^{\circ }\mathrm{sin}7{0}^{\circ }\\ =0\end{array}$

コード

#!/usr/bin/env python3
from unittest import TestCase, main
from sympy import pprint, symbols, sin, cos, rad

print('36.')

class MyTestCase(TestCase):
def test1(self):

def test2(self):

def test3(self):
self.assertAlmostEqual(

if __name__ == '__main__':
main()


% ./sample36.py -v
36.
test1 (__main__.MyTestCase) ... ok
test2 (__main__.MyTestCase) ... ok
test3 (__main__.MyTestCase) ... ok

----------------------------------------------------------------------
Ran 3 tests in 0.040s

OK
%