<jupyter_start><jupyter_text>Trigonometric PatternsLike a spirograph! Trigonometric identity function`y = a * sin(k*x + w) + b`where:* `a`: amplitude* `k`: frequency* `w`: phase* `b`: offset  Matplotlib<jupyter_code>import numpy as np
import matplotlib.pyplot as plt

from generators import trigonometric
n = 1000
m = 10
t = np.linspace(-n*m*np.pi, n*m*np.pi, n)
r = (t % n)
a = t // 10
b = 0
k = 1
w = 0
x = a * np.sin(k*t + w) + b
y = a * np.cos(k*t + w) + b
fig = plt.figure(figsize=(15, 10))

ax = plt.axes()
ax.set_aspect('equal')

plt.plot(x, y)
t = np.linspace(-2*np.pi, 2*np.pi, 100)
r = 2
m = 1

x1 = r * np.sin(t)
y1 = np.cos(t+m)

x2 = np.sin(t+m)
y2 = r * np.cos(t)

x3 = r * np.sin(t)
y3 = np.cos(t-m)

x4 = np.sin(t-m)
y4 = r * np.cos(t)
fig = plt.figure(figsize=(15, 10))

ax = plt.axes()
ax.set_xlim([-5, 5])
ax.set_ylim([-5, 5])
ax.set_aspect('equal')

plt.plot(x1, y1, 'g',
         x2, y2, 'r',
         x3, y3, 'k',
         x4, y4, 'y')
n = 1
t = np.linspace(-n*np.pi, n*np.pi, 100)
m = np.cos(t)
r = np.sin(t)

x1 = np.sin(t+m)
y1 = r * np.cos(t)

x2 = np.sin(t-m)
y2 = r * np.cos(t)
fig = plt.figure(figsize=(15, 10))

ax = plt.axes()
ax.set_xlim([-5, 5])
ax.set_ylim([-5, 5])
ax.set_aspect('equal')

plt.plot(x1, y1, 'g',
         x2, y2, 'r')<jupyter_output><empty_output><jupyter_text>HoloViz<jupyter_code>import holoviews as hv
import panel as pn

hv.extension('bokeh')
n = pn.widgets.IntSlider(name='n', start=10, end=1000, step=1, value=100)
m = pn.widgets.IntSlider(name='m', start=2, end=100, step=1, value=20)

@pn.depends(n.param.value, m.param.value)
def make_plot(n, m):
    x, y = trigonometric(n, m)
    return hv.Curve(zip(x, y)).opts(width=500, height=500)

pn.Row(pn.Column(n, m), make_plot)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21124361158432708, 'fraction_numerical': 0.05053946621237933, 'mean_word_length': 3.6861702127659575, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '93056', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 933, 'n_tokens_neox': 879, 'n_words': 191, 'path': 'examples/trigonometric.ipynb', 'repo_name': 'informatics-lab/dashboarding-examples', 'size': '1761'}