2020年6月10日水曜日

学習環境

代数への出発 (新装版 数学入門シリーズ) (松坂 和夫(著)、岩波書店)の第6章(1次方程式、2次方程式)、練習問題1の解答を求めてみる。


  1. S = { 0 ( 0 t 2 ) 2 ( 2 t - 4 ) ( 2 t 4 ) 8 ( 4 t 6 ) 2 ( 4 - ( 2 t - 12 ) ) ( 6 t 8 )
    S = { 0 ( n t 2 n ) 4 t + 8 ( 2 n t 4 n ) 8 ( 4 n t 6 n ) - 4 t + 32 ( 6 n t 8 n ) ( n = 0 , 1 , )

コード

#!/usr/bin/env python3
from sympy import symbols, plot
from sympy.abc import t

print('1.')

colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']

p = plot((0, (t, 0, 2)),
         (2 * (2 * t - 4), (t, 2, 4)),
         (8, (t, 4, 6)),
         (2 * (4 - (2 * t - 12)), (t, 6, 8)),
         legend=True,
         show=False)
for o, color in zip(p, colors):
    o.line_color = color
p.save('sample1.png')
p.show()

入出力結果(Zsh、PowerShell、Terminal、Jupyter(IPython))

% ./sample1.py
1.
%

0 コメント:

コメントを投稿