Skip to content

Commit

Permalink
fix: : microscope: Fix zoom factor calculation in theory functions (#28)
Browse files Browse the repository at this point in the history
* fix: Update zoom factor calculation in theory functions

* docs: Update `*.gif`
  • Loading branch information
Anselmoo authored Jul 20, 2024
1 parent fd42c2f commit 483838c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Binary file modified docs/extra/images/RiemannFunction.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/extra/images/TakagiFunction.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/extra/images/WeierstrassFunction.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 15 additions & 9 deletions umf/functions/theory/pathological.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ class WeierstrassFunction(PathologicalWithCoefficients):
>>> (ax_return,) = ax.plot(x, wf.result)
>>> def update(frame: int) -> tuple:
... zoom_factor = frame / 25.0
... ax.set_xlim(-3 + zoom_factor, 3 - zoom_factor)
... ax.set_xlim(
... -3 + zoom_factor / 1.3, 3 - zoom_factor/ 1.3
... )
... ax.set_ylim(
... -2.5 + zoom_factor / 2.5, 2.5 - zoom_factor / 5
... )
... -2.5 + zoom_factor / 2.5, 2.5 - zoom_factor / 5
... )
... return (ax_return,)
>>> ani = FuncAnimation(fig, update, frames=np.arange(0, 100), blit=True)
>>> ani.save('WeierstrassFunction.gif', writer='imagemagick', fps=10)
Expand Down Expand Up @@ -129,10 +131,12 @@ class RiemannFunction(PathologicalPure):
>>> (ax_return,) = ax.plot(x, rf.result)
>>> def update(frame: int) -> tuple:
... zoom_factor = frame / 25.0
... ax.set_xlim(-3 + zoom_factor, 3 - zoom_factor)
... ax.set_xlim(
... -3 + zoom_factor / 1.3, 3 - zoom_factor / 1.3
... )
... ax.set_ylim(
... -2.5 + zoom_factor / 5, 2.5 - zoom_factor / 5
... )
... -2.5 + zoom_factor / 5, 2.5 - zoom_factor / 5
... )
... return (ax_return,)
>>> ani = FuncAnimation(fig, update, frames=np.arange(0, 100), blit=True)
>>> ani.save('RiemannFunction.gif', writer='imagemagick', fps=10)
Expand Down Expand Up @@ -189,10 +193,12 @@ class TakagiFunction(PathologicalPure):
>>> (ax_return,) = ax.plot(x, tf.result)
>>> def update(frame: int) -> tuple:
... zoom_factor = frame / 25.0
... ax.set_xlim(-1.5 + zoom_factor/2, 1.5 - zoom_factor/2)
... ax.set_xlim(
... -1.5 + zoom_factor / 2.5, 1.5 - zoom_factor / 2.5
... )
... ax.set_ylim(
... 0 + zoom_factor / 25, 0.6 - zoom_factor / 25
... )
... 0 + zoom_factor / 25, 0.6 - zoom_factor / 25
... )
... return (ax_return,)
>>> ani = FuncAnimation(fig, update, frames=np.arange(0, 100), blit=True)
>>> ani.save('TakagiFunction.gif', writer='imagemagick', fps=10)
Expand Down

0 comments on commit 483838c

Please sign in to comment.