From 5aea7e8b0288bee32c91b974e9f351782c5b00a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=A0=80?= Date: Sun, 12 Nov 2023 17:56:16 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=AA=E1=B4=A5=E2=9A=AA=E1=97=B1=E1=97=B4?= =?UTF-8?q?=E2=9A=AA=E2=9C=A4=E2=9A=AA=E2=93=84=E2=9A=AA=E1=99=81=E2=9A=AA?= =?UTF-8?q?=DF=A6=E2=9A=AA=E2=97=AF=E2=9A=AA=E1=97=B1=E1=97=B4=E2=9A=AA?= =?UTF-8?q?=E1=97=AF=E2=9A=AA=E1=B4=A5=E2=9A=AA=E1=91=8E=E2=9A=AA=E1=91=90?= =?UTF-8?q?=E1=91=95=E2=9A=AA=E2=97=AF=E2=9A=AA=D0=98N=E2=9A=AA=E2=93=84?= =?UTF-8?q?=E2=9A=AA=EA=96=B4=E2=9A=AA=E2=9C=A4=E2=9A=AA=E1=91=90=E1=91=95?= =?UTF-8?q?=E2=9A=AA=E1=91=8E=E2=9A=AA=EA=97=B3=E2=9A=AA=E2=97=AF=E2=9A=AA?= =?UTF-8?q?=E1=97=B1=E1=97=B4=E2=9A=AA=E1=B4=A5=E2=9A=AA=E1=91=8E=E2=9A=AA?= =?UTF-8?q?=E2=9C=A4=E2=9A=AA=E1=97=A9=E2=9A=AA=E1=97=AF=E2=9A=AA=E1=B4=A5?= =?UTF-8?q?=E2=9A=AA=E1=91=8E=E2=9A=AA=E1=91=90=E1=91=95=E2=9A=AA=E2=97=AF?= =?UTF-8?q?=E2=9A=AA=E1=97=9D=E2=9A=AA=E1=97=B1=E1=97=B4=E2=9A=AA=EA=96=B4?= =?UTF-8?q?=E2=9A=AA=EA=97=B3=E2=9A=AA=EA=96=B4=E2=9A=AA=E1=91=90=E1=91=95?= =?UTF-8?q?=E2=9A=AA=E1=97=B1=E1=97=B4=E2=9A=AA=DF=A6=E2=9A=AA=E1=94=93?= =?UTF-8?q?=E1=94=95=E2=9A=AA=E2=97=8C=E2=9A=AA=E2=97=8C=E2=9A=AA=E2=97=8C?= =?UTF-8?q?=E2=9A=AA=E2=97=8C=E2=9A=AA=E2=97=8C=E2=9A=AA=E2=97=8C=E2=9A=AA?= =?UTF-8?q?=E1=94=93=E1=94=95=E2=9A=AA=DF=A6=E2=9A=AA=E1=97=B1=E1=97=B4?= =?UTF-8?q?=E2=9A=AA=E1=91=90=E1=91=95=E2=9A=AA=EA=96=B4=E2=9A=AA=EA=97=B3?= =?UTF-8?q?=E2=9A=AA=EA=96=B4=E2=9A=AA=E1=97=B1=E1=97=B4=E2=9A=AA=E1=97=9D?= =?UTF-8?q?=E2=9A=AA=E2=97=AF=E2=9A=AA=E1=91=90=E1=91=95=E2=9A=AA=E1=91=8E?= =?UTF-8?q?=E2=9A=AA=E1=B4=A5=E2=9A=AA=E1=97=AF=E2=9A=AA=E1=97=A9=E2=9A=AA?= =?UTF-8?q?=E2=9C=A4=E2=9A=AA=E1=91=8E=E2=9A=AA=E1=B4=A5=E2=9A=AA=E1=97=B1?= =?UTF-8?q?=E1=97=B4=E2=9A=AA=E2=97=AF=E2=9A=AA=EA=97=B3=E2=9A=AA=E1=91=8E?= =?UTF-8?q?=E2=9A=AA=E1=91=90=E1=91=95=E2=9A=AA=E2=9C=A4=E2=9A=AA=EA=96=B4?= =?UTF-8?q?=E2=9A=AA=E2=93=84=E2=9A=AA=D0=98N=E2=9A=AA=E2=97=AF=E2=9A=AA?= =?UTF-8?q?=E1=91=90=E1=91=95=E2=9A=AA=E1=91=8E=E2=9A=AA=E1=B4=A5=E2=9A=AA?= =?UTF-8?q?=E1=97=AF=E2=9A=AA=E1=97=B1=E1=97=B4=E2=9A=AA=E2=97=AF=E2=9A=AA?= =?UTF-8?q?=DF=A6=E2=9A=AA=E1=99=81=E2=9A=AA=E2=93=84=E2=9A=AA=E2=9C=A4?= =?UTF-8?q?=E2=9A=AA=E1=97=B1=E1=97=B4=E2=9A=AA=E1=B4=A5=E2=9A=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...βšͺί¦βšͺβ—―βšͺα—±α—΄βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺИNβšͺβ“„βšͺκ–΄βšͺ✀βšͺᑐᑕβšͺα‘Žβšͺκ—³βšͺβ—―βšͺα—±α—΄βšͺα΄₯βšͺα‘Žβšͺ✀βšͺα—©βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺᗝβšͺα—±α—΄βšͺκ–΄βšͺκ—³βšͺκ–΄βšͺᑐᑕβšͺα—±α—΄βšͺί¦βšͺα”“α”•βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺα”“α”•βšͺί¦βšͺα—±α—΄βšͺᑐᑕβšͺκ–΄βšͺκ—³βšͺκ–΄βšͺα—±α—΄βšͺᗝβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—©βšͺ✀βšͺα‘Žβšͺα΄₯βšͺα—±α—΄βšͺβ—―βšͺκ—³βšͺα‘Žβšͺᑐᑕβšͺ✀βšͺκ–΄βšͺβ“„βšͺИNβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—±α—΄βšͺβ—―βšͺί¦βšͺᙁβšͺβ“„βšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ.IPYNB | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/βšͺᕀᕦβšͺИNβšͺκ–΄βšͺᙏβšͺα—©βšͺα΄₯βšͺᕀᕦβšͺβ“„βšͺα΄₯βšͺί¦βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺί¦βšͺα΄₯βšͺβ“„βšͺᕀᕦβšͺα΄₯βšͺα—©βšͺᙏβšͺκ–΄βšͺИNβšͺᕀᕦβšͺ/βšͺИNβšͺβ“„βšͺ옷βšͺ✀βšͺδΊΊβšͺί¦βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺί¦βšͺδΊΊβšͺ✀βšͺ옷βšͺβ“„βšͺИNβšͺ/βšͺα΄₯βšͺα—±α—΄βšͺ✀βšͺδΊΊβšͺί¦βšͺα‘Žβšͺᒍᒐβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺᒍᒐβšͺα‘Žβšͺί¦βšͺδΊΊβšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ/BИYPI.βšͺα΄₯βšͺα—±α—΄βšͺ✀βšͺβ“„βšͺᙁβšͺί¦βšͺβ—―βšͺα—±α—΄βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺИNβšͺβ“„βšͺκ–΄βšͺ✀βšͺᑐᑕβšͺα‘Žβšͺκ—³βšͺβ—―βšͺα—±α—΄βšͺα΄₯βšͺα‘Žβšͺ✀βšͺα—©βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺᗝβšͺα—±α—΄βšͺκ–΄βšͺκ—³βšͺκ–΄βšͺᑐᑕβšͺα—±α—΄βšͺί¦βšͺα”“α”•βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺα”“α”•βšͺί¦βšͺα—±α—΄βšͺᑐᑕβšͺκ–΄βšͺκ—³βšͺκ–΄βšͺα—±α—΄βšͺᗝβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—©βšͺ✀βšͺα‘Žβšͺα΄₯βšͺα—±α—΄βšͺβ—―βšͺκ—³βšͺα‘Žβšͺᑐᑕβšͺ✀βšͺκ–΄βšͺβ“„βšͺИNβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—±α—΄βšͺβ—―βšͺί¦βšͺᙁβšͺβ“„βšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ.IPYNB b/βšͺᕀᕦβšͺИNβšͺκ–΄βšͺᙏβšͺα—©βšͺα΄₯βšͺᕀᕦβšͺβ“„βšͺα΄₯βšͺί¦βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺί¦βšͺα΄₯βšͺβ“„βšͺᕀᕦβšͺα΄₯βšͺα—©βšͺᙏβšͺκ–΄βšͺИNβšͺᕀᕦβšͺ/βšͺИNβšͺβ“„βšͺ옷βšͺ✀βšͺδΊΊβšͺί¦βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺί¦βšͺδΊΊβšͺ✀βšͺ옷βšͺβ“„βšͺИNβšͺ/βšͺα΄₯βšͺα—±α—΄βšͺ✀βšͺδΊΊβšͺί¦βšͺα‘Žβšͺᒍᒐβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺᒍᒐβšͺα‘Žβšͺί¦βšͺδΊΊβšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ/BИYPI.βšͺα΄₯βšͺα—±α—΄βšͺ✀βšͺβ“„βšͺᙁβšͺί¦βšͺβ—―βšͺα—±α—΄βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺИNβšͺβ“„βšͺκ–΄βšͺ✀βšͺᑐᑕβšͺα‘Žβšͺκ—³βšͺβ—―βšͺα—±α—΄βšͺα΄₯βšͺα‘Žβšͺ✀βšͺα—©βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺᗝβšͺα—±α—΄βšͺκ–΄βšͺκ—³βšͺκ–΄βšͺᑐᑕβšͺα—±α—΄βšͺί¦βšͺα”“α”•βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺα”“α”•βšͺί¦βšͺα—±α—΄βšͺᑐᑕβšͺκ–΄βšͺκ—³βšͺκ–΄βšͺα—±α—΄βšͺᗝβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—©βšͺ✀βšͺα‘Žβšͺα΄₯βšͺα—±α—΄βšͺβ—―βšͺκ—³βšͺα‘Žβšͺᑐᑕβšͺ✀βšͺκ–΄βšͺβ“„βšͺИNβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—±α—΄βšͺβ—―βšͺί¦βšͺᙁβšͺβ“„βšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ.IPYNB index bcde9b9b..4d97ab41 100644 --- a/βšͺᕀᕦβšͺИNβšͺκ–΄βšͺᙏβšͺα—©βšͺα΄₯βšͺᕀᕦβšͺβ“„βšͺα΄₯βšͺί¦βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺί¦βšͺα΄₯βšͺβ“„βšͺᕀᕦβšͺα΄₯βšͺα—©βšͺᙏβšͺκ–΄βšͺИNβšͺᕀᕦβšͺ/βšͺИNβšͺβ“„βšͺ옷βšͺ✀βšͺδΊΊβšͺί¦βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺί¦βšͺδΊΊβšͺ✀βšͺ옷βšͺβ“„βšͺИNβšͺ/βšͺα΄₯βšͺα—±α—΄βšͺ✀βšͺδΊΊβšͺί¦βšͺα‘Žβšͺᒍᒐβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺᒍᒐβšͺα‘Žβšͺί¦βšͺδΊΊβšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ/BИYPI.βšͺα΄₯βšͺα—±α—΄βšͺ✀βšͺβ“„βšͺᙁβšͺί¦βšͺβ—―βšͺα—±α—΄βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺИNβšͺβ“„βšͺκ–΄βšͺ✀βšͺᑐᑕβšͺα‘Žβšͺκ—³βšͺβ—―βšͺα—±α—΄βšͺα΄₯βšͺα‘Žβšͺ✀βšͺα—©βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺᗝβšͺα—±α—΄βšͺκ–΄βšͺκ—³βšͺκ–΄βšͺᑐᑕβšͺα—±α—΄βšͺί¦βšͺα”“α”•βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺα”“α”•βšͺί¦βšͺα—±α—΄βšͺᑐᑕβšͺκ–΄βšͺκ—³βšͺκ–΄βšͺα—±α—΄βšͺᗝβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—©βšͺ✀βšͺα‘Žβšͺα΄₯βšͺα—±α—΄βšͺβ—―βšͺκ—³βšͺα‘Žβšͺᑐᑕβšͺ✀βšͺκ–΄βšͺβ“„βšͺИNβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—±α—΄βšͺβ—―βšͺί¦βšͺᙁβšͺβ“„βšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ.IPYNB +++ b/βšͺᕀᕦβšͺИNβšͺκ–΄βšͺᙏβšͺα—©βšͺα΄₯βšͺᕀᕦβšͺβ“„βšͺα΄₯βšͺί¦βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺί¦βšͺα΄₯βšͺβ“„βšͺᕀᕦβšͺα΄₯βšͺα—©βšͺᙏβšͺκ–΄βšͺИNβšͺᕀᕦβšͺ/βšͺИNβšͺβ“„βšͺ옷βšͺ✀βšͺδΊΊβšͺί¦βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺί¦βšͺδΊΊβšͺ✀βšͺ옷βšͺβ“„βšͺИNβšͺ/βšͺα΄₯βšͺα—±α—΄βšͺ✀βšͺδΊΊβšͺί¦βšͺα‘Žβšͺᒍᒐβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺᒍᒐβšͺα‘Žβšͺί¦βšͺδΊΊβšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ/BИYPI.βšͺα΄₯βšͺα—±α—΄βšͺ✀βšͺβ“„βšͺᙁβšͺί¦βšͺβ—―βšͺα—±α—΄βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺИNβšͺβ“„βšͺκ–΄βšͺ✀βšͺᑐᑕβšͺα‘Žβšͺκ—³βšͺβ—―βšͺα—±α—΄βšͺα΄₯βšͺα‘Žβšͺ✀βšͺα—©βšͺα—―βšͺα΄₯βšͺα‘Žβšͺᑐᑕβšͺβ—―βšͺᗝβšͺα—±α—΄βšͺκ–΄βšͺκ—³βšͺκ–΄βšͺᑐᑕβšͺα—±α—΄βšͺί¦βšͺα”“α”•βšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺβ—Œβšͺα”“α”•βšͺί¦βšͺα—±α—΄βšͺᑐᑕβšͺκ–΄βšͺκ—³βšͺκ–΄βšͺα—±α—΄βšͺᗝβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—©βšͺ✀βšͺα‘Žβšͺα΄₯βšͺα—±α—΄βšͺβ—―βšͺκ—³βšͺα‘Žβšͺᑐᑕβšͺ✀βšͺκ–΄βšͺβ“„βšͺИNβšͺβ—―βšͺᑐᑕβšͺα‘Žβšͺα΄₯βšͺα—―βšͺα—±α—΄βšͺβ—―βšͺί¦βšͺᙁβšͺβ“„βšͺ✀βšͺα—±α—΄βšͺα΄₯βšͺ.IPYNB @@ -1 +1 @@ -{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[],"dockerImageVersionId":30579,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nfrom ipywidgets import interact\nimport plotly.graph_objects as go\nfrom math import *\n\ndef kappa(formula, x):\n return eval(formula, {'acos': acos, 'exp': exp, 'cos': cos, 'sin': sin, 'pi': pi, 'x': x})\n\ndef plot(formula='(1 + cos(((4)/2)*x))/2', RANGE_FROM=0, RANGE_TO=4*pi, N=10):\n num_points = 1+2**N\n\n # Generate x values with the specified number of points\n x_vals = np.linspace(RANGE_FROM, RANGE_TO, num_points)\n\n # Compute kappa values\n kappa_vals = np.array([kappa(formula, x_val) for x_val in x_vals])\n\n theta_vals = np.cumsum(kappa_vals) * (x_vals[1]-x_vals[0]) if num_points > 1 else np.array([0])\n x_coords_ = np.cumsum(np.cos(theta_vals)) * (x_vals[1] - x_vals[0]) if num_points > 1 else np.array([0])\n y_coords_ = np.cumsum(np.sin(theta_vals)) * (x_vals[1] - x_vals[0]) if num_points > 1 else np.array([0])\n\n # Check if the first point is zero, if not, add it manually\n if x_coords_[0] != 0 or y_coords_[0] != 0:\n x_coords = np.insert(x_coords_, 0, 0)\n y_coords = np.insert(y_coords_, 0, 0)\n else:\n x_coords = x_coords_\n y_coords = y_coords_\n\n fig = go.Figure()\n\n fig.add_trace(go.Scatter(x=x_coords, y=y_coords, mode='lines', name='Curve'))\n\n fig.update_layout(autosize=True, xaxis=dict(scaleanchor='y', scaleratio=1))\n fig.show()\n\n# Create the interactive plot\ninteract(plot, formula='(1 + cos(((4)/2)*x))/2', RANGE_FROM=(0, 4*pi, pi/4), RANGE_TO=(0, 4*pi, pi/4), N=(1,16));","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_kg_hide-input":true,"execution":{"iopub.status.busy":"2023-11-12T07:01:38.567603Z","iopub.execute_input":"2023-11-12T07:01:38.568046Z","iopub.status.idle":"2023-11-12T07:01:39.122214Z","shell.execute_reply.started":"2023-11-12T07:01:38.568004Z","shell.execute_reply":"2023-11-12T07:01:39.121279Z"},"jupyter":{"source_hidden":true},"trusted":true},"execution_count":1,"outputs":[{"output_type":"display_data","data":{"text/plain":"interactive(children=(Text(value='(1 + cos(((4)/2)*x))/2', description='formula'), FloatSlider(value=0.0, desc…","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"97d06e9715754ecbac76d3fbd0d3df08"}},"metadata":{}}]}]} \ No newline at end of file +{"cells":[{"cell_type":"code","metadata":{"source_hash":null,"execution_start":1699791503509,"execution_millis":1453,"deepnote_app_coordinates":{"h":5,"w":12,"x":0,"y":0},"deepnote_to_be_reexecuted":false,"cell_id":"1c24d01f42554ffc8072aff5dcd23315","deepnote_cell_type":"code"},"source":"import numpy as np\nimport plotly.graph_objects as go\nfrom math import *\nimport mpmath\nfrom ipywidgets import interact, widgets\n\nN_slider = widgets.IntSlider(min=1, max=16, value=8)\nRANGE_FROM_SLIDER=widgets.FloatSlider(min=0, max=4*pi, value=0*pi, step=pi/4)\nRANGE_TO_SLIDER=widgets.FloatSlider(min=0, max=4*pi, value=4*pi,step=pi/4)\ndef clamp(x):\n return max(min(1, x), -1)\ndef kappa(formula, x):\n func_dict = {fn: eval(f'lambda *args: mpmath.{fn}(*args)') for fn in dir(mpmath)}\n return float(eval(formula, {'x': x, 'clamp': clamp, **func_dict}))\ndef plot(formula='(1 - cos(((4)/2)*x))/2', RANGE_FROM=0, RANGE_TO=4*pi, N=10):\n num_points = 1+2**N\n\n # Generate x values with the specified number of points\n x_vals = np.linspace(RANGE_FROM, RANGE_TO, num_points)\n\n # Compute kappa values\n kappa_vals = np.array([kappa(formula, x_val) for x_val in x_vals])\n\n theta_vals = np.cumsum(kappa_vals) * (x_vals[1]-x_vals[0]) if num_points > 1 else np.array([0])\n x_coords_ = np.cumsum(np.cos(theta_vals)) * (x_vals[1] - x_vals[0]) if num_points > 1 else np.array([0])\n y_coords_ = np.cumsum(np.sin(theta_vals)) * (x_vals[1] - x_vals[0]) if num_points > 1 else np.array([0])\n\n # Check if the first point is zero, if not, add it manually\n if x_coords_[0] != 0 or y_coords_[0] != 0:\n x_coords = np.insert(x_coords_, 0, 0)\n y_coords = np.insert(y_coords_, 0, 0)\n else:\n x_coords = x_coords_\n y_coords = y_coords_\n\n fig = go.Figure()\n\n fig.add_trace(go.Scatter(x=x_coords, y=y_coords, mode='lines', name='Curve'))\n\n fig.update_layout(autosize=True, xaxis=dict(scaleanchor='y', scaleratio=1))\n fig.show()\n\n# Create the interactive plot\ninteract(plot, formula='(1 - cos(((4)/2)*x))/2', RANGE_FROM=RANGE_FROM_SLIDER, RANGE_TO=RANGE_TO_SLIDER, N=N_slider);","block_group":"1c24d01f42554ffc8072aff5dcd23315","execution_count":null,"outputs":[{"output_type":"clear_output"},{"data":{"text/html":"\n\n\n
\n
\n\n"},"metadata":{},"output_type":"display_data"},{"data":{"text/plain":"interactive(children=(Text(value='(1 - cos(((4)/2)*x))/2', description='formula'), FloatSlider(value=0.0, desc…","application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"a6f66cae72174032b9a24f7703c7a81c"}},"metadata":{},"output_type":"display_data"}]},{"cell_type":"markdown","source":"\nCreated in deepnote.com \nCreated in Deepnote","metadata":{"created_in_deepnote_cell":true,"deepnote_cell_type":"markdown"}}],"nbformat":4,"nbformat_minor":0,"metadata":{"deepnote":{},"orig_nbformat":2,"deepnote_app_width":"full-width","deepnote_app_layout":"powerful-article","deepnote_notebook_id":"c317aba669da4fb499152be5080afa28","deepnote_app_clear_outputs":false,"deepnote_app_comments_enabled":false,"deepnote_execution_queue":[]}} \ No newline at end of file