diff options
| author | Andrew Guschin <saintruler@gmail.com> | 2021-04-06 14:58:29 +0400 |
|---|---|---|
| committer | Andrew Guschin <saintruler@gmail.com> | 2021-04-06 14:58:29 +0400 |
| commit | efa32bdc3fc03264272acc10216b891e2f7916d6 (patch) | |
| tree | 9d1e9622ff85439651a8399feccead2c8972ce70 /python-graphics/plotter.py | |
| parent | c763f723095ada3fc1c683929a410ef533cfa93d (diff) | |
Добавил sin и cos в предустановленные функции
Diffstat (limited to 'python-graphics/plotter.py')
| -rw-r--r-- | python-graphics/plotter.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python-graphics/plotter.py b/python-graphics/plotter.py index 6ab8275..32d96b2 100644 --- a/python-graphics/plotter.py +++ b/python-graphics/plotter.py @@ -17,6 +17,12 @@ def plot_preset(data): y = a * x**2 + b * x + c elif data["type"] == "line": y = a * x + b + elif data["type"] == "sin": + c = data["c"] + y = a * np.sin(b * x + c) + elif data["type"] == "cos": + c = data["c"] + y = a * np.cos(b * x + c) # setting the axes at the centre fig = plt.figure() |