学習環境
- Surface
- Windows 10 Pro (OS)
- Nebo(Windowsアプリ)
- iPad
- MyScript Nebo - MyScript(iPadアプリ(iOS))
- 参考書籍
新装版 数学読本2 (松坂 和夫(著)、岩波書店)の第8章(円の中にひそむ関数 - 三角関数)、8.1(一般角と三角関数)、簡単な三角方程式と三角不等式の問12の解答を求めてみる。
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, sin, cos, tan, plot
print('12.')
x = symbols('x')
fs = [sin(x), cos(x), sin(2 * x), cos(x / 2), tan(x), tan(2 * x)]
p = plot(*fs,
         ylim=(-10, 10),
         legend=True,
         show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']
for s, color in zip(p, colors):
    s.line_color = color
p.save(f'sample12.png')
p.show()
入出力結果(Zsh、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))
% ./sample12.py 12. %
 
0 コメント:
コメントを投稿