学習環境
- Surface、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro 10.5 + Apple Pencil
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
微分積分学 (ちくま学芸文庫) (吉田 洋一(著)、筑摩書房)のI.(微分法)、演習問題 I.、1、2、3、4の解答を求めてみる。
各関数のグラフ。
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, sqrt, plot, Rational
print('1.')
x = symbols('x')
fs = [(sqrt(1 - x ** 2), (-1, 1)),
(x ** Rational(1, 2), (0, 5)),
(2 * x + x ** 2, (-5, 5)),
(abs(2 * x + 1), (-5, 5))]
for f, _ in fs:
pprint(f)
print()
p = plot(*[(f, (x, x1, x2)) for f, (x1, x2) in fs],
ylim=(-5, 5),
legend=True, show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']
for o, color in zip(p, colors):
o.line_color = color
p.show()
p.save('sample1.png')
入出力結果(Bash、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))
C:\Users\...>py sample1.py 1. ________ ╱ 2 ╲╱ 1 - x √x 2 x + 2⋅x │2⋅x + 1│ c:\Users\...>
0 コメント:
コメントを投稿