From efa32bdc3fc03264272acc10216b891e2f7916d6 Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Tue, 6 Apr 2021 14:58:29 +0400 Subject: =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20sin=20?= =?UTF-8?q?=D0=B8=20cos=20=D0=B2=20=D0=BF=D1=80=D0=B5=D0=B4=D1=83=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D0=B5=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python-graphics/plotter.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python-graphics/plotter.py') 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() -- cgit v1.2.3