├── .gitignore ├── .idea ├── .gitignore ├── EquationTracer.iml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── misc.xml ├── modules.xml └── vcs.xml ├── LICENSE ├── README.md ├── equationtracer ├── __init__.py ├── __main__.py ├── button.py ├── keyboard.py ├── main.py └── printers.py ├── poetry.lock └── pyproject.toml /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/#use-with-ide 110 | .pdm.toml 111 | 112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 113 | __pypackages__/ 114 | 115 | # Celery stuff 116 | celerybeat-schedule 117 | celerybeat.pid 118 | 119 | # SageMath parsed files 120 | *.sage.py 121 | 122 | # Environments 123 | .env 124 | .venv 125 | env/ 126 | venv/ 127 | ENV/ 128 | env.bak/ 129 | venv.bak/ 130 | 131 | # Spyder project settings 132 | .spyderproject 133 | .spyproject 134 | 135 | # Rope project settings 136 | .ropeproject 137 | 138 | # mkdocs documentation 139 | /site 140 | 141 | # mypy 142 | .mypy_cache/ 143 | .dmypy.json 144 | dmypy.json 145 | 146 | # Pyre type checker 147 | .pyre/ 148 | 149 | # pytype static type analyzer 150 | .pytype/ 151 | 152 | # Cython debug symbols 153 | cython_debug/ 154 | 155 | .DS_Store/ 156 | equationtracer/.DS_Store/ 157 | 158 | # PyCharm 159 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 160 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 161 | # and can be added to the global gitignore or merged into this file. For a more nuclear 162 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 163 | #.idea/ 164 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/EquationTracer.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 jamesylq 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What is EquationTracer? 2 | EquationTracer uses NumPy and Pygame to convert an arbitrary scribble into a parametric equation which you can plot on Graphing Calculators such as Desmos! 3 | 4 | ## Installation 5 | This is a guide on how to install EquationTracer. 6 | >**Note**: You need Python installed on your system, along with either pip or pipx. 7 | 8 | If you do not want to use pip or pipx, you can also alternatively clone this git repository, or simply copy the code! 9 | 10 | Linux: `pip install equationtracer` 11 | 12 | Mac: `pip3 install equationtracer` 13 | 14 | Windows (pipx): `pipx install equationtracer` 15 | 16 | Windows (pip): `pip install equationtracer` 17 | 18 | >**Note**: For Windows, it is recommended to use pipx as using pip does not allow the poetry script `trace-equation` to run, but pipx does support this. If pip is used, you need to run the program with the other command, as provided below. On Max and Linux, pip3 will automatically allow the poetry script `trace-equation` to be able to be executed. 19 | 20 | ## Running 21 | To run the program, type into a command line: `trace-equation` 22 | 23 | If you installed the program with pip (instead of pipx) on windows, or if the above command doesn't work, you can also do: 24 | 25 | Windows: `py -m equationtracer` 26 | 27 | Others: `python3 -m equationtracer` 28 | 29 | ## Updating 30 | 31 | To update the program, use the following: 32 | 33 | Linux: `pip install -U equationtracer` 34 | 35 | Mac: `pip3 install -U equationtracer` 36 | 37 | Windows (pipx): `pipx upgrade equationtracer` 38 | 39 | Windows (pip): `pip install -U equationtracer` 40 | 41 | ## Dependencies 42 | 43 | EquationTracer uses the libraries numpy, pygame and pyperclip, and runs on Python 3.9 and above. -------------------------------------------------------------------------------- /equationtracer/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.3.0" 2 | -------------------------------------------------------------------------------- /equationtracer/__main__.py: -------------------------------------------------------------------------------- 1 | try: 2 | from main import main 3 | except (NameError, FileNotFoundError, ModuleNotFoundError): 4 | from equationtracer.main import main 5 | 6 | main() 7 | -------------------------------------------------------------------------------- /equationtracer/button.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | from typing import * 3 | 4 | try: 5 | from printers import * 6 | except (ModuleNotFoundError, NameError, FileNotFoundError): 7 | from equationtracer.printers import * 8 | 9 | 10 | class ButtonStyle: 11 | def __init__(self, *, fillColor: Tuple[int, int, int] = None, hoverFillColor: Tuple[int, int, int] = None, 12 | hoverBorderColor: Tuple[int, int, int] = None, borderColor: Tuple[int, int, int] = None, 13 | borderThickness: int = None, texture: pygame.SurfaceType = None, collisionTexture: pygame.SurfaceType = None, 14 | font: pygame.font.Font = None, fontColor: Tuple[int, int, int] = None): 15 | self.font = font 16 | self.texture = texture 17 | self.fillColor = fillColor 18 | self.fontColor = fontColor 19 | self.borderColor = borderColor 20 | self.borderThickness = borderThickness 21 | self.hoverFillColor = hoverFillColor if hoverFillColor is not None else fillColor 22 | self.hoverBorderColor = hoverBorderColor if hoverBorderColor is not None else borderColor 23 | self.collisionTexture = texture if collisionTexture is None and texture is not None else collisionTexture 24 | 25 | 26 | class Button: 27 | def __init__(self, rect: Tuple[int, int, int, int], *, texture: pygame.SurfaceType = None, text: str = '', 28 | fillColor: Tuple[int, int, int] = (64, 64, 64), hoverFillColor: Tuple[int, int, int] = None, 29 | hoverBorderColor: Tuple[int, int, int] = None, borderColor: Tuple[int, int, int] = (0, 0, 0), 30 | borderThickness: int = 3, collisionTexture: Union[str, pygame.SurfaceType] = None, 31 | font: pygame.font.Font = None, fontColor: Tuple[int, int, int] = (0, 0, 0), 32 | style: ButtonStyle = None) -> None: 33 | 34 | ButtonManager.buttons.append(self) 35 | 36 | self.font = font 37 | self.rect = rect 38 | self.text = text 39 | self.texture = texture 40 | self.fillColor = fillColor 41 | self.fontColor = fontColor 42 | self.borderColor = borderColor 43 | self.x, self.y, self.w, self.h = rect 44 | self.borderThickness = borderThickness 45 | self.centre = (self.x + self.w // 2, self.y + self.h // 2) 46 | self.hoverFillColor = hoverFillColor if hoverFillColor is not None else fillColor 47 | self.hoverBorderColor = hoverBorderColor if hoverBorderColor is not None else borderColor 48 | self.collisionTexture = texture if collisionTexture is None and texture is not None else collisionTexture 49 | 50 | if style is not None: 51 | for k, v in self.__dict__.items(): 52 | try: 53 | sv = style.__getattribute__(k) 54 | if sv is not None and v != sv: 55 | self.__setattr__(k, sv) 56 | except AttributeError: 57 | continue 58 | 59 | def update(self) -> None: 60 | self.rect = (self.x, self.y, self.w, self.h) 61 | self.centre = (self.x + self.w // 2, self.y + self.h // 2) 62 | 63 | def draw(self, mousePos: Tuple[int, int]) -> None: 64 | self.update() 65 | 66 | if collision(mousePos, self.rect): 67 | if self.collisionTexture is None: 68 | pygame.draw.rect(ButtonManager.screen, self.hoverFillColor, self.rect) 69 | else: 70 | ButtonManager.screen.blit(self.collisionTexture, self.centre, self.fontColor) 71 | centredPrint(ButtonManager.screen, self.font, self.text, self.centre, self.fontColor) 72 | 73 | if self.borderThickness > 0: 74 | pygame.draw.rect(ButtonManager.screen, self.hoverBorderColor, self.rect, self.borderThickness) 75 | 76 | else: 77 | if self.texture is None: 78 | pygame.draw.rect(ButtonManager.screen, self.fillColor, self.rect) 79 | else: 80 | ButtonManager.screen.blit(self.texture, self.centre) 81 | centredPrint(ButtonManager.screen, self.font, self.text, self.centre, self.fontColor) 82 | 83 | if self.borderThickness > 0: 84 | pygame.draw.rect(ButtonManager.screen, self.borderColor, self.rect, self.borderThickness) 85 | 86 | def check(self) -> bool: 87 | return collision(ButtonManager.mousePos, self.rect) 88 | 89 | 90 | def collision(point: Tuple[int, int], rect: Tuple[int, int, int, int]) -> bool: 91 | return rect[0] <= point[0] < rect[0] + rect[2] and rect[1] <= point[1] < rect[1] + rect[3] 92 | 93 | 94 | class ButtonManager: 95 | buttons: List[Button] = [] 96 | screen: pygame.Surface = None 97 | mousePos: Tuple[int, int] = (-1, -1) 98 | 99 | def __init__(self, surface: pygame.Surface) -> None: 100 | ButtonManager.screen = surface 101 | 102 | def __len__(self) -> int: 103 | return len(ButtonManager.buttons) 104 | 105 | 106 | def updateButtons(mousePos: Tuple[int, int] = None, active: List[Button] = None, *, updateScreen: bool = False) -> List[str]: 107 | executeCommands = [] 108 | ButtonManager.mousePos = pygame.mouse.get_pos() if mousePos is None else mousePos 109 | 110 | if active is None: 111 | active = ButtonManager.buttons 112 | 113 | for button in active: 114 | button.draw(mousePos) 115 | 116 | if updateScreen: 117 | pygame.display.update() 118 | 119 | return executeCommands 120 | -------------------------------------------------------------------------------- /equationtracer/keyboard.py: -------------------------------------------------------------------------------- 1 | from pygame import * 2 | 3 | MIN = -1e9 4 | MAX = 1e9 5 | 6 | FIELDS = [ 7 | ["Size of Window as Rendered", (0, MAX), 10], 8 | ["x-Coordinate as Rendered", (MIN, MAX), 0], 9 | ["y-Coordinate as Rendered", (MIN, MAX), 0], 10 | ["Degree of Generated Equation", (5, 50), 25] 11 | ] 12 | 13 | KEYS = { 14 | K_0: '0', 15 | K_1: '1', 16 | K_2: '2', 17 | K_3: '3', 18 | K_4: '4', 19 | K_5: '5', 20 | K_6: '6', 21 | K_7: '7', 22 | K_8: '8', 23 | K_9: '9', 24 | K_PERIOD: '.', 25 | K_KP_PERIOD: '.', 26 | K_MINUS: '-', 27 | K_KP_MINUS: '-', 28 | } -------------------------------------------------------------------------------- /equationtracer/main.py: -------------------------------------------------------------------------------- 1 | # Imports 2 | import pygame 3 | import pyperclip 4 | from numpy import * 5 | from typing import * 6 | 7 | try: 8 | from button import * 9 | from printers import * 10 | from keyboard import * 11 | except (ModuleNotFoundError, NameError, FileNotFoundError): 12 | from equationtracer.button import * 13 | from equationtracer.printers import * 14 | from equationtracer.keyboard import * 15 | 16 | 17 | # Pygame Setup 18 | clock = pygame.time.Clock() 19 | screen = pygame.display.set_mode((500, 500)) 20 | pygame.display.set_caption("EquationTracer") 21 | pygame.init() 22 | pygame.font.init() 23 | font = pygame.font.SysFont("Arial", 20) 24 | tinyfont = pygame.font.SysFont("Arial", 15) 25 | 26 | 27 | # Buttons Setup 28 | buttons = ButtonManager(screen) 29 | STYLE = ButtonStyle(font=tinyfont, fillColor=(200, 200, 200), borderColor=(100, 100, 100), hoverBorderColor=(255, 255, 255)) 30 | 31 | BEGIN_DRAWING = Button((350, 460, 140, 30), text="Start Drawing!", style=STYLE) 32 | REDO_PARAMS = Button((10, 460, 140, 30), text="Modify Settings", style=STYLE) 33 | REDRAW_CURVE = Button((10, 460, 140, 30), text="Redraw Curve", style=STYLE) 34 | COPY_CLIPBOARD = Button((350, 460, 140, 30), text="Copy to Clipboard", style=STYLE) 35 | 36 | GROUP_1 = [BEGIN_DRAWING] 37 | GROUP_2 = [REDO_PARAMS] 38 | GROUP_3 = [REDRAW_CURVE, COPY_CLIPBOARD] 39 | 40 | 41 | # Global Parameters 42 | n = 25 43 | x = 0 44 | y = 0 45 | s = 10 46 | fields = [str(x[2]) for x in FIELDS] 47 | 48 | 49 | def generateEquation(points) -> Tuple[str, List[Tuple[float, float]]]: 50 | global n, x, y, s 51 | 52 | for m in range(len(points) - 1, -1, -1): 53 | points[m] = (points[m][0] - 250, 250 - points[m][1]) 54 | points.append(points[m]) 55 | 56 | xt = yt = "" 57 | M = len(points) 58 | r = [] 59 | for k in range(-n, n + 1): 60 | cx = cy = 0 61 | for m in range(M): 62 | cx += cos(2 * pi * k * m / M) * points[m][0] + sin(2 * pi * k * m / M) * points[m][1] 63 | cy += cos(2 * pi * k * m / M) * points[m][1] - sin(2 * pi * k * m / M) * points[m][0] 64 | 65 | if k != -n: 66 | xt += " + " 67 | yt += " + " 68 | 69 | xt += f"{cx / M} cos({k * pi}t) - {cy / M} sin({k * pi}t)" 70 | yt += f"{cx / M} sin({k * pi}t) + {cy / M} cos({k * pi}t)" 71 | r.append((cx / M, cy / M)) 72 | 73 | eq = f"({x} + {s}({xt}), {y} + {s}({yt}))".replace(" + -", " - ").replace(" - -", " + ") 74 | return eq, r 75 | 76 | 77 | def getParams() -> None: 78 | global n, x, y, s, fields 79 | 80 | selected = selectedx = delta = -1 81 | flashcount = 0 82 | 83 | while True: 84 | mx, my = pygame.mouse.get_pos() 85 | 86 | screen.fill((0, 0, 0)) 87 | updateButtons((mx, my), GROUP_1) 88 | 89 | centredPrint(screen, font, "Parameters", (250, 20)) 90 | centredPrint(screen, tinyfont, "Default Settings are automatically provided!", (250, 40)) 91 | 92 | for l in range(len(FIELDS)): 93 | rightAlignPrint(screen, tinyfont, FIELDS[l][0] + ": ", (225, 100 + 50 * l)) 94 | pygame.draw.rect(screen, (200, 200, 200), (240, 85 + 50 * l, 250, 30)) 95 | leftAlignPrint(screen, tinyfont, fields[l], (245, 100 + 50 * l), (0, 0, 0)) 96 | 97 | if l == selected and flashcount < 30: 98 | length = tinyfont.size(fields[l][:selectedx])[0] 99 | pygame.draw.line(screen, (0, 0, 0), (245 + length, 90 + 50 * l), (245 + length, 110 + 50 * l)) 100 | 101 | for event in pygame.event.get(): 102 | if event.type == pygame.QUIT: 103 | quit() 104 | 105 | if event.type == pygame.MOUSEBUTTONDOWN: 106 | if event.button == 1: 107 | if BEGIN_DRAWING.check(): 108 | s, x, y, n = map(float, fields) 109 | n = int(n) 110 | s /= 250 111 | 112 | screen.fill((0, 0, 0)) 113 | pygame.display.update() 114 | return 115 | 116 | if 240 <= mx <= 490 and (my - 85) % 50 <= 30 and 85 <= my < 65 + 50 * len(FIELDS): 117 | selected = (my - 85) // 50 118 | selectedx = min((mx - 240) // tinyfont.size('a')[0], len(fields[selected])) 119 | 120 | elif selected != -1: 121 | f = fields[selected].split('.') 122 | if selected == 3: 123 | fields[selected] = f[0] 124 | else: 125 | if len(f) > 2: 126 | fields[selected] = f[0] + '.' + ''.join([f[s] for s in range(1, len(f))]) 127 | f = fields[selected].split('.') 128 | 129 | if len(f) == 2 and int(f[1]) == 0: 130 | fields[selected] = f[0] 131 | 132 | while len(fields[selected]) > 1 and fields[selected][0] == '0': 133 | fields[selected] = fields[selected][1:] 134 | 135 | fields[selected] = str(min(max(float(fields[selected]), FIELDS[selected][1][0]), FIELDS[selected][1][1])) 136 | if fields[selected][-2:] == '.0': 137 | fields[selected] = fields[selected][:-2] 138 | selected = -1 139 | 140 | if event.type == pygame.KEYDOWN: 141 | if selected != -1 and event.key in KEYS.keys(): 142 | fields[selected] = fields[selected][:selectedx] + KEYS[event.key] + fields[selected][selectedx:] 143 | selectedx += 1 144 | 145 | if event.key == pygame.K_BACKSPACE: 146 | delta = flashcount % 5 147 | 148 | if selected != -1 and selectedx: 149 | pressed = pygame.key.get_pressed() 150 | if pressed[pygame.K_BACKSPACE] and (flashcount - delta) % 5 == 0: 151 | fields[selected] = fields[selected][:selectedx - 1] + fields[selected][selectedx:] 152 | selectedx -= 1 153 | 154 | flashcount = (flashcount + 1) % 50 155 | 156 | pygame.display.update() 157 | clock.tick(100) 158 | 159 | 160 | def drawCurve() -> List[Tuple[int, int]]: 161 | points = [] 162 | drawing = False 163 | 164 | while True: 165 | screen.fill((0, 0, 0)) 166 | mousePos = pygame.mouse.get_pos() 167 | 168 | updateButtons(mousePos, GROUP_2) 169 | 170 | if drawing: 171 | points.append(mousePos) 172 | 173 | centredPrint(screen, font, "Draw a Continuous Curve!", (250, 20)) 174 | 175 | for i in range(len(points) - 1): 176 | pygame.draw.line(screen, (255, 255, 255), points[i], points[i + 1], 3) 177 | 178 | for event in pygame.event.get(): 179 | if event.type == pygame.QUIT: 180 | quit() 181 | 182 | if event.type == pygame.MOUSEBUTTONDOWN: 183 | if event.button == 1: 184 | if REDO_PARAMS.check(): 185 | getParams() 186 | return drawCurve() 187 | else: 188 | drawing = True 189 | 190 | if event.type == pygame.MOUSEBUTTONUP: 191 | if event.button == 1 and drawing: 192 | return points 193 | 194 | pygame.display.update() 195 | clock.tick(100) 196 | 197 | 198 | def preview(eq: str, r: List[Tuple[float, float]]) -> None: 199 | vects = [] 200 | precomp = [] 201 | for tm in range(1000): 202 | dx = 0 203 | dy = 0 204 | vect = [] 205 | for k in range(n, -1, -1): 206 | cx = r[n + k][0] * cos(k * pi * tm / 1000) - r[n + k][1] * sin(k * pi * tm / 1000) 207 | cy = r[n + k][1] * cos(k * pi * tm / 1000) + r[n + k][0] * sin(k * pi * tm / 1000) 208 | dx += cx 209 | dy += cy 210 | vect.append((cx, cy)) 211 | 212 | if k == 0: 213 | break 214 | 215 | cx = r[n - k][0] * cos(k * pi * tm / 1000) + r[n - k][1] * sin(k * pi * tm / 1000) 216 | cy = r[n - k][1] * cos(k * pi * tm / 1000) - r[n - k][0] * sin(k * pi * tm / 1000) 217 | dx += cx 218 | dy += cy 219 | vect.append((cx, cy)) 220 | 221 | vects.append(vect) 222 | precomp.append((250 + dx, 250 - dy)) 223 | 224 | T = 0 225 | while True: 226 | mx, my = pygame.mouse.get_pos() 227 | 228 | screen.fill((0, 0, 0)) 229 | updateButtons((mx, my), GROUP_3) 230 | centredPrint(screen, font, "Equation Generated!", (250, 20)) 231 | 232 | prev = (250, 250) 233 | for k in range(-n, n + 1): 234 | curr = (prev[0] + vects[T][k + n][0], prev[1] - vects[T][k + n][1]) 235 | pygame.draw.line(screen, (100, 100, 100), prev, curr, 3) 236 | pygame.draw.circle(screen, (150, 150, 150), curr, 2) 237 | prev = curr 238 | 239 | for i in range(T): 240 | pygame.draw.line(screen, (255, 255, 255), precomp[i], precomp[i + 1], 3) 241 | 242 | for event in pygame.event.get(): 243 | if event.type == pygame.QUIT: 244 | quit() 245 | 246 | if event.type == pygame.MOUSEBUTTONDOWN: 247 | if event.button == 1: 248 | if COPY_CLIPBOARD.check(): 249 | pyperclip.copy(eq) 250 | 251 | elif REDRAW_CURVE.check(): 252 | eq, r = generateEquation(drawCurve()) 253 | preview(eq, r) 254 | return 255 | 256 | pygame.display.update() 257 | clock.tick(100) 258 | 259 | T = (T + 1) % 1000 260 | 261 | 262 | def main() -> None: 263 | global s, x, y, n 264 | 265 | getParams() 266 | eq, r = generateEquation(drawCurve()) 267 | preview(eq, r) 268 | -------------------------------------------------------------------------------- /equationtracer/printers.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | from typing import Tuple 3 | 4 | 5 | def leftAlignPrint(scr: pygame.Surface, ft: pygame.font.Font, text: str, pos: Tuple[int, int], color: Tuple[int, int, int] = (255, 255, 255)) -> None: 6 | textObj = ft.render(text, True, color) 7 | scr.blit(textObj, textObj.get_rect(center=[pos[0] + ft.size(text)[0] / 2, pos[1]])) 8 | 9 | 10 | def centredPrint(scr: pygame.Surface, ft: pygame.font.Font, text: str, pos: Tuple[int, int], color: Tuple[int, int, int] = (255, 255, 255)) -> None: 11 | textObj = ft.render(text, True, color) 12 | scr.blit(textObj, textObj.get_rect(center=pos)) 13 | 14 | 15 | def rightAlignPrint(scr: pygame.Surface, ft: pygame.font.Font, text: str, pos: Tuple[int, int], color: Tuple[int, int, int] = (255, 255, 255)) -> None: 16 | textObj = ft.render(text, True, color) 17 | scr.blit(textObj, textObj.get_rect(center=[pos[0] - ft.size(text)[0] / 2, pos[1]])) 18 | -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. 2 | 3 | [[package]] 4 | name = "numpy" 5 | version = "1.26.2" 6 | description = "Fundamental package for array computing in Python" 7 | optional = false 8 | python-versions = ">=3.9" 9 | files = [ 10 | {file = "numpy-1.26.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3703fc9258a4a122d17043e57b35e5ef1c5a5837c3db8be396c82e04c1cf9b0f"}, 11 | {file = "numpy-1.26.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cc392fdcbd21d4be6ae1bb4475a03ce3b025cd49a9be5345d76d7585aea69440"}, 12 | {file = "numpy-1.26.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:36340109af8da8805d8851ef1d74761b3b88e81a9bd80b290bbfed61bd2b4f75"}, 13 | {file = "numpy-1.26.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bcc008217145b3d77abd3e4d5ef586e3bdfba8fe17940769f8aa09b99e856c00"}, 14 | {file = "numpy-1.26.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3ced40d4e9e18242f70dd02d739e44698df3dcb010d31f495ff00a31ef6014fe"}, 15 | {file = "numpy-1.26.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b272d4cecc32c9e19911891446b72e986157e6a1809b7b56518b4f3755267523"}, 16 | {file = "numpy-1.26.2-cp310-cp310-win32.whl", hash = "sha256:22f8fc02fdbc829e7a8c578dd8d2e15a9074b630d4da29cda483337e300e3ee9"}, 17 | {file = "numpy-1.26.2-cp310-cp310-win_amd64.whl", hash = "sha256:26c9d33f8e8b846d5a65dd068c14e04018d05533b348d9eaeef6c1bd787f9919"}, 18 | {file = "numpy-1.26.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b96e7b9c624ef3ae2ae0e04fa9b460f6b9f17ad8b4bec6d7756510f1f6c0c841"}, 19 | {file = "numpy-1.26.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aa18428111fb9a591d7a9cc1b48150097ba6a7e8299fb56bdf574df650e7d1f1"}, 20 | {file = "numpy-1.26.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:06fa1ed84aa60ea6ef9f91ba57b5ed963c3729534e6e54055fc151fad0423f0a"}, 21 | {file = "numpy-1.26.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96ca5482c3dbdd051bcd1fce8034603d6ebfc125a7bd59f55b40d8f5d246832b"}, 22 | {file = "numpy-1.26.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:854ab91a2906ef29dc3925a064fcd365c7b4da743f84b123002f6139bcb3f8a7"}, 23 | {file = "numpy-1.26.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f43740ab089277d403aa07567be138fc2a89d4d9892d113b76153e0e412409f8"}, 24 | {file = "numpy-1.26.2-cp311-cp311-win32.whl", hash = "sha256:a2bbc29fcb1771cd7b7425f98b05307776a6baf43035d3b80c4b0f29e9545186"}, 25 | {file = "numpy-1.26.2-cp311-cp311-win_amd64.whl", hash = "sha256:2b3fca8a5b00184828d12b073af4d0fc5fdd94b1632c2477526f6bd7842d700d"}, 26 | {file = "numpy-1.26.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a4cd6ed4a339c21f1d1b0fdf13426cb3b284555c27ac2f156dfdaaa7e16bfab0"}, 27 | {file = "numpy-1.26.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5d5244aabd6ed7f312268b9247be47343a654ebea52a60f002dc70c769048e75"}, 28 | {file = "numpy-1.26.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a3cdb4d9c70e6b8c0814239ead47da00934666f668426fc6e94cce869e13fd7"}, 29 | {file = "numpy-1.26.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa317b2325f7aa0a9471663e6093c210cb2ae9c0ad824732b307d2c51983d5b6"}, 30 | {file = "numpy-1.26.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:174a8880739c16c925799c018f3f55b8130c1f7c8e75ab0a6fa9d41cab092fd6"}, 31 | {file = "numpy-1.26.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f79b231bf5c16b1f39c7f4875e1ded36abee1591e98742b05d8a0fb55d8a3eec"}, 32 | {file = "numpy-1.26.2-cp312-cp312-win32.whl", hash = "sha256:4a06263321dfd3598cacb252f51e521a8cb4b6df471bb12a7ee5cbab20ea9167"}, 33 | {file = "numpy-1.26.2-cp312-cp312-win_amd64.whl", hash = "sha256:b04f5dc6b3efdaab541f7857351aac359e6ae3c126e2edb376929bd3b7f92d7e"}, 34 | {file = "numpy-1.26.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4eb8df4bf8d3d90d091e0146f6c28492b0be84da3e409ebef54349f71ed271ef"}, 35 | {file = "numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1a13860fdcd95de7cf58bd6f8bc5a5ef81c0b0625eb2c9a783948847abbef2c2"}, 36 | {file = "numpy-1.26.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64308ebc366a8ed63fd0bf426b6a9468060962f1a4339ab1074c228fa6ade8e3"}, 37 | {file = "numpy-1.26.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baf8aab04a2c0e859da118f0b38617e5ee65d75b83795055fb66c0d5e9e9b818"}, 38 | {file = "numpy-1.26.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d73a3abcac238250091b11caef9ad12413dab01669511779bc9b29261dd50210"}, 39 | {file = "numpy-1.26.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:b361d369fc7e5e1714cf827b731ca32bff8d411212fccd29ad98ad622449cc36"}, 40 | {file = "numpy-1.26.2-cp39-cp39-win32.whl", hash = "sha256:bd3f0091e845164a20bd5a326860c840fe2af79fa12e0469a12768a3ec578d80"}, 41 | {file = "numpy-1.26.2-cp39-cp39-win_amd64.whl", hash = "sha256:2beef57fb031dcc0dc8fa4fe297a742027b954949cabb52a2a376c144e5e6060"}, 42 | {file = "numpy-1.26.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1cc3d5029a30fb5f06704ad6b23b35e11309491c999838c31f124fee32107c79"}, 43 | {file = "numpy-1.26.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94cc3c222bb9fb5a12e334d0479b97bb2df446fbe622b470928f5284ffca3f8d"}, 44 | {file = "numpy-1.26.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:fe6b44fb8fcdf7eda4ef4461b97b3f63c466b27ab151bec2366db8b197387841"}, 45 | {file = "numpy-1.26.2.tar.gz", hash = "sha256:f65738447676ab5777f11e6bbbdb8ce11b785e105f690bc45966574816b6d3ea"}, 46 | ] 47 | 48 | [[package]] 49 | name = "pygame" 50 | version = "2.5.2" 51 | description = "Python Game Development" 52 | optional = false 53 | python-versions = ">=3.6" 54 | files = [ 55 | {file = "pygame-2.5.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a0769eb628c818761755eb0a0ca8216b95270ea8cbcbc82227e39ac9644643da"}, 56 | {file = "pygame-2.5.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ed9a3d98adafa0805ccbaaff5d2996a2b5795381285d8437a4a5d248dbd12b4a"}, 57 | {file = "pygame-2.5.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f30d1618672a55e8c6669281ba264464b3ab563158e40d89e8c8b3faa0febebd"}, 58 | {file = "pygame-2.5.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:39690e9be9baf58b7359d1f3b2336e1fd6f92fedbbce42987be5df27f8d30718"}, 59 | {file = "pygame-2.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03879ec299c9f4ba23901b2649a96b2143f0a5d787f0b6c39469989e2320caf1"}, 60 | {file = "pygame-2.5.2-cp310-cp310-win32.whl", hash = "sha256:74e1d6284100e294f445832e6f6343be4fe4748decc4f8a51131ae197dae8584"}, 61 | {file = "pygame-2.5.2-cp310-cp310-win_amd64.whl", hash = "sha256:485239c7d32265fd35b76ae8f64f34b0637ae11e69d76de15710c4b9edcc7c8d"}, 62 | {file = "pygame-2.5.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:34646ca20e163dc6f6cf8170f1e12a2e41726780112594ac061fa448cf7ccd75"}, 63 | {file = "pygame-2.5.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3b8a6e351665ed26ea791f0e1fd649d3f483e8681892caef9d471f488f9ea5ee"}, 64 | {file = "pygame-2.5.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc346965847aef00013fa2364f41a64f068cd096dcc7778fc306ca3735f0eedf"}, 65 | {file = "pygame-2.5.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:35632035fd81261f2d797fa810ea8c46111bd78ceb6089d52b61ed7dc3c5d05f"}, 66 | {file = "pygame-2.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e24d05184e4195fe5ebcdce8b18ecb086f00182b9ae460a86682d312ce8d31f"}, 67 | {file = "pygame-2.5.2-cp311-cp311-win32.whl", hash = "sha256:f02c1c7505af18d426d355ac9872bd5c916b27f7b0fe224749930662bea47a50"}, 68 | {file = "pygame-2.5.2-cp311-cp311-win_amd64.whl", hash = "sha256:6d58c8cf937815d3b7cdc0fa9590c5129cb2c9658b72d00e8a4568dea2ff1d42"}, 69 | {file = "pygame-2.5.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1a2a43802bb5e89ce2b3b775744e78db4f9a201bf8d059b946c61722840ceea8"}, 70 | {file = "pygame-2.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1c289f2613c44fe70a1e40769de4a49c5ab5a29b9376f1692bb1a15c9c1c9bfa"}, 71 | {file = "pygame-2.5.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:074aa6c6e110c925f7f27f00c7733c6303407edc61d738882985091d1eb2ef17"}, 72 | {file = "pygame-2.5.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fe0228501ec616779a0b9c4299e837877783e18df294dd690b9ab0eed3d8aaab"}, 73 | {file = "pygame-2.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31648d38ecdc2335ffc0e38fb18a84b3339730521505dac68514f83a1092e3f4"}, 74 | {file = "pygame-2.5.2-cp312-cp312-win32.whl", hash = "sha256:224c308856334bc792f696e9278e50d099a87c116f7fc314cd6aa3ff99d21592"}, 75 | {file = "pygame-2.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:dd2d2650faf54f9a0f5bd0db8409f79609319725f8f08af6507a0609deadcad4"}, 76 | {file = "pygame-2.5.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:9b30bc1220c457169571aac998e54b013aaeb732d2fd8744966cb1cfab1f61d1"}, 77 | {file = "pygame-2.5.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78fcd7643358b886a44127ff7dec9041c056c212b3a98977674f83f99e9b12d3"}, 78 | {file = "pygame-2.5.2-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:35cf093a51cb294ede56c29d4acf41538c00f297fcf78a9b186fb7d23c0577b6"}, 79 | {file = "pygame-2.5.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fe323acbf53a0195c8c98b1b941eba7ac24e3e2b28ae48e8cda566f15fc4945"}, 80 | {file = "pygame-2.5.2-cp36-cp36m-win32.whl", hash = "sha256:5697528266b4716d9cdd44a5a1d210f4d86ef801d0f64ca5da5d0816704009d9"}, 81 | {file = "pygame-2.5.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edda1f7cff4806a4fa39e0e8ccd75f38d1d340fa5fc52d8582ade87aca247d92"}, 82 | {file = "pygame-2.5.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:9bd738fd4ecc224769d0b4a719f96900a86578e26e0105193658a32966df2aae"}, 83 | {file = "pygame-2.5.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30a8d7cf12363b4140bf2f93b5eec4028376ca1d0fe4b550588f836279485308"}, 84 | {file = "pygame-2.5.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bc12e4dea3e88ea8a553de6d56a37b704dbe2aed95105889f6afeb4b96e62097"}, 85 | {file = "pygame-2.5.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b34c73cb328024f8db3cb6487a37e54000148988275d8d6e5adf99d9323c937"}, 86 | {file = "pygame-2.5.2-cp37-cp37m-win32.whl", hash = "sha256:7d0a2794649defa57ef50b096a99f7113d3d0c2e32d1426cafa7d618eadce4c7"}, 87 | {file = "pygame-2.5.2-cp37-cp37m-win_amd64.whl", hash = "sha256:41f8779f52e0f6e6e6ccb8f0b5536e432bf386ee29c721a1c22cada7767b0cef"}, 88 | {file = "pygame-2.5.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:677e37bc0ea7afd89dde5a88ced4458aa8656159c70a576eea68b5622ee1997b"}, 89 | {file = "pygame-2.5.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:47a8415d2bd60e6909823b5643a1d4ef5cc29417d817f2a214b255f6fa3a1e4c"}, 90 | {file = "pygame-2.5.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ff21201df6278b8ca2e948fb148ffe88f5481fd03760f381dd61e45954c7dff"}, 91 | {file = "pygame-2.5.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d29a84b2e02814b9ba925357fd2e1df78efe5e1aa64dc3051eaed95d2b96eafd"}, 92 | {file = "pygame-2.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d78485c4d21133d6b2fbb504cd544ca655e50b6eb551d2995b3aa6035928adda"}, 93 | {file = "pygame-2.5.2-cp38-cp38-win32.whl", hash = "sha256:d851247239548aa357c4a6840fb67adc2d570ce7cb56988d036a723d26b48bff"}, 94 | {file = "pygame-2.5.2-cp38-cp38-win_amd64.whl", hash = "sha256:88d1cdacc2d3471eceab98bf0c93c14d3a8461f93e58e3d926f20d4de3a75554"}, 95 | {file = "pygame-2.5.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4f1559e7efe4efb9dc19d2d811d702f325d9605f9f6f9ececa39ee6890c798f5"}, 96 | {file = "pygame-2.5.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cf2191b756ceb0e8458a761d0c665b0c70b538570449e0d39b75a5ba94ac5cf0"}, 97 | {file = "pygame-2.5.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6cf2257447ce7f2d6de37e5fb019d2bbe32ed05a5721ace8bc78c2d9beaf3aee"}, 98 | {file = "pygame-2.5.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d75cbbfaba2b81434d62631d0b08b85fab16cf4a36e40b80298d3868927e1299"}, 99 | {file = "pygame-2.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:daca456d5b9f52e088e06a127dec182b3638a775684fb2260f25d664351cf1ae"}, 100 | {file = "pygame-2.5.2-cp39-cp39-win32.whl", hash = "sha256:3b3e619e33d11c297d7a57a82db40681f9c2c3ae1d5bf06003520b4fe30c435d"}, 101 | {file = "pygame-2.5.2-cp39-cp39-win_amd64.whl", hash = "sha256:1822d534bb7fe756804647b6da2c9ea5d7a62d8796b2e15d172d3be085de28c6"}, 102 | {file = "pygame-2.5.2-pp36-pypy36_pp73-win32.whl", hash = "sha256:e708fc8f709a0fe1d1876489345f2e443d47f3976d33455e2e1e937f972f8677"}, 103 | {file = "pygame-2.5.2-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c13edebc43c240fb0532969e914f0ccefff5ae7e50b0b788d08ad2c15ef793e4"}, 104 | {file = "pygame-2.5.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:263b4a7cbfc9fe2055abc21b0251cc17dea6dff750f0e1c598919ff350cdbffe"}, 105 | {file = "pygame-2.5.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:e58e2b0c791041e4bccafa5bd7650623ba1592b8fe62ae0a276b7d0ecb314b6c"}, 106 | {file = "pygame-2.5.2-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a0bd67426c02ffe6c9827fc4bcbda9442fbc451d29b17c83a3c088c56fef2c90"}, 107 | {file = "pygame-2.5.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9dcff6cbba1584cf7732ce1dbdd044406cd4f6e296d13bcb7fba963fb4aeefc9"}, 108 | {file = "pygame-2.5.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ce4b6c0bfe44d00bb0998a6517bd0cf9455f642f30f91bc671ad41c05bf6f6ae"}, 109 | {file = "pygame-2.5.2-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:68c4e8e60b725ffc7a6c6ecd9bb5fcc5ed2d6e0e2a2c4a29a8454856ef16ad63"}, 110 | {file = "pygame-2.5.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f3849f97372a3381c66955f99a0d58485ccd513c3d00c030b869094ce6997a6"}, 111 | {file = "pygame-2.5.2.tar.gz", hash = "sha256:c1b89eb5d539e7ac5cf75513125fb5f2f0a2d918b1fd6e981f23bf0ac1b1c24a"}, 112 | ] 113 | 114 | [[package]] 115 | name = "pyperclip" 116 | version = "1.8.2" 117 | description = "A cross-platform clipboard module for Python. (Only handles plain text for now.)" 118 | optional = false 119 | python-versions = "*" 120 | files = [ 121 | {file = "pyperclip-1.8.2.tar.gz", hash = "sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57"}, 122 | ] 123 | 124 | [metadata] 125 | lock-version = "2.0" 126 | python-versions = "^3.9" 127 | content-hash = "8b2fcbd3bf9d5b97bde29bd2cfe27c333cd5a1ba824833e7fa74838f582a52e6" 128 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "equationtracer" 3 | version = "1.3.0" 4 | description = "Uses Discrete Fourier Transform to Turn Scribbles into Equations!" 5 | authors = ["Ying Liqian "] 6 | readme = "README.md" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.9" 10 | pygame = "^2.5.2" 11 | numpy = "^1.26.3" 12 | pyperclip = "^1.8.2" 13 | 14 | 15 | [build-system] 16 | requires = ["poetry-core"] 17 | build-backend = "poetry.core.masonry.api" 18 | 19 | [tool.poetry.scripts] 20 | trace-equation = "equationtracer.main:main" --------------------------------------------------------------------------------