{"id":27924437,"url":"https://github.com/oonap0oo/small-python-projects","last_synced_at":"2026-05-15T20:03:06.599Z","repository":{"id":283119297,"uuid":"950752254","full_name":"oonap0oo/small-Python-projects","owner":"oonap0oo","description":"small pieces of Python code","archived":false,"fork":false,"pushed_at":"2025-07-28T10:44:20.000Z","size":12160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T12:31:22.615Z","etag":null,"topics":["matplotlib-python","numpy-python","python","scipy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oonap0oo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-18T16:25:52.000Z","updated_at":"2025-07-28T10:44:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d96f546-2148-4d8f-a76f-c68bab62873f","html_url":"https://github.com/oonap0oo/small-Python-projects","commit_stats":null,"previous_names":["oonap0oo/small-pyhton-projects"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oonap0oo/small-Python-projects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oonap0oo%2Fsmall-Python-projects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oonap0oo%2Fsmall-Python-projects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oonap0oo%2Fsmall-Python-projects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oonap0oo%2Fsmall-Python-projects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oonap0oo","download_url":"https://codeload.github.com/oonap0oo/small-Python-projects/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oonap0oo%2Fsmall-Python-projects/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269185726,"owners_count":24374634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matplotlib-python","numpy-python","python","scipy"],"created_at":"2025-05-06T23:50:39.480Z","updated_at":"2026-05-15T20:03:06.592Z","avatar_url":"https://github.com/oonap0oo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# small-Python-projects\nsmall pieces of Python code \n\n## Sections\n\n1. [Fractals and strange attractors](https://github.com/oonap0oo/small-Python-projects#fractals-and-strange-attractors)\n    * [mandelbrot_v1.py](https://github.com/oonap0oo/small-Python-projects#mandelbrot_v1py)\n\n    * [mandelbrot_v1_detail.py](https://github.com/oonap0oo/small-Python-projects#mandelbrot_v1_detailpy)\nThis code calculates a image of the Mandelbrot set,\n\n    * [julia_v1.py](https://github.com/oonap0oo/small-Python-projects#julia_v1py)\nA modification of the Mandelbrot code allows to calculate the Julia set.\n\n    * [julia_tkinter.py](https://github.com/oonap0oo/small-Python-projects#julia_tkinterpy)\nA simple approach plotting a colorful julia fractal directly on a tkinter canvas.\n\n    * [julia_pil_image.py](https://github.com/oonap0oo/small-Python-projects#julia_pil_imagepy)\nPlotting a Julia fractal directly to a image which opens in the standard image viewer using the PIL library.\n\n   * [mandelbrot_pil_image.py](https://github.com/oonap0oo/small-Python-projects#mandelbrot_pil_imagepy)\nPlotting a mandelbrot fractal directly to a image which opens in the standard image viewer using the PIL library.\n\n   * [logistic_map_calculate_image_v3.py](https://github.com/oonap0oo/small-Python-projects#logistic_map_calculate_image_v3py)\nThis code calculates an image of the bifurcation diagram for the logistic map.\n\n   * [logistic_map_tkinter.py](https://github.com/oonap0oo/small-Python-projects#logistic_map_tkinterpy)\n   This simple script uses only the tkinter library which comes with CPython to display a logistic map.\n\n   * [kings_dream_cpython.py](https://github.com/oonap0oo/small-Python-projects#kings_dream_cpythonpy)\nThis script draws the Kings Dream fractal, many variations are possible.\n\n   * [hopalong.py](https://github.com/oonap0oo/small-Python-projects#hopalongpy)\nA variation of the code for the 'King's dream fractal' yields this 'hopalong' fractal.\n\n   * [tinkerbell.py](https://github.com/oonap0oo/small-Python-projects#tinkerbellpy)\nA variation of the code for the 'King's dream fractal' yields this 'tinkerbell' fractal. \n\n   * [quadrup_two.py](https://github.com/oonap0oo/small-Python-projects#quadrup_twopy)\nA further variation of the code for the 'King's dream fractal' yields the 'Quadrup Two' fractal. \n\n   * [Gumowski_Mira.py](https://github.com/oonap0oo/small-Python-projects#Gumowski_Mirapy)\nThis Gumowski-Mira fractal, very sensitive to modifications of it's parameters.\n\n   * [sierpinski_triangle_tkinter_v6.py](https://github.com/oonap0oo/small-Python-projects#sierpinski_triangle_tkinter_v6py)\nSierpinski Triangle constructed using the Chaos game method. It rotates and scales in and out.\n\n   * [pascal_triangle_ansi.py](https://github.com/oonap0oo/small-Python-projects#pascal_triangle_ansipy)\nThis code calculates the first 32 rows of Pascal's triangle. It then prints the last digit of each value by marking if that digit is uneven, the Sierpinski triangle appears. This version uses ANSI escape codes to generate colors and reverse characters\n\n   * [pascal_triangle_no_ansi_v2.py](https://github.com/oonap0oo/small-Python-projects#pascal_triangle_no_ansi_v2py)\nThis version avoids using ANSI escape codes by reprinting the triangle using a character in place of uneven values\n\n   * [mandelbrot_text_CPython.py](https://github.com/oonap0oo/small-Python-projects#mandelbrot_text_CPythonpy)\nThis code displays a text output of the Mandelbrot fractal. ANSI commands are used to generate color.\n\n   * [mandelbrot_text_CPython_no_ansi.py](https://github.com/oonap0oo/small-Python-projects#mandelbrot_text_CPython_no_ansipy)\nA version of mandelbrot_text_CPython.py without the ANSI commands.\n\n   * [sierpinsky_turtle_cpython.py](https://github.com/oonap0oo/small-Python-projects#sierpinsky_turtle_cpythonpy)\nThis script draws a Sierpinsky triangle recursively using turtle.\n\n   * [logistic_map_test_v2.py](https://github.com/oonap0oo/small-Python-projects#logistic_map_test_v2py)\nGenerating a bifurcation diagram of the Logistic Map. using Numpy and Matplotlib\n\n   * [gingerbread_CPython.py](https://github.com/oonap0oo/small-Python-projects#gingerbread_CPythonpy)\nThis script draws a “Gingerbread man” fractal.\n\n   * [recursive_tree_canvas_v4.py](https://github.com/oonap0oo/small-Python-projects#recursive_tree_canvas_v4py)\nDrawing recursive trees on a Tkinter canvas.\n\n   * [koch_snowflake_antisnowflake.py](https://github.com/oonap0oo/small-Python-projects#koch_snowflake_antisnowflakepy)\nThe Koch Snowflake and Antisnowflake are constructed using recursive function calls.\n\n   * [rabinovich_fabrikant_system.py](https://github.com/oonap0oo/small-Python-projects#rabinovich_fabrikant_systempy)\nThis script generates 3D plot of a solution to the Rabinovich–Fabrikant System for given parameters and initial conditions.\n\n   * [thomas_attractor.py](https://github.com/oonap0oo/small-Python-projects#thomas_attractorpy)\nThis plots the Thomas attractor for given parameter b and initial conditions.\n\n\n2. [Calculating and plotting using Numpy and Matplotlib](https://github.com/oonap0oo/small-Python-projects#calculating-and-plotting-using-numpy-and-matplotlib)\n   * [pi_monte_carlo_circle.py](https://github.com/oonap0oo/small-Python-projects#pi_monte_carlo_circlepy)\nApproximation of pi using a circle and random points\n\n   * [perimeter_ellipse_v4.py](https://github.com/oonap0oo/small-Python-projects#perimeter_ellipse_v4py)\nNumerically calucating the perimeter of an ellipse\n\n   * [wbridge.py](https://github.com/oonap0oo/small-Python-projects#wbridgepy)\nCalculate output voltage of a Wheatstone Bridge as function of one variable resistor Rx \n\n   * [lorenz_system_scipy_numpy_v2.py](https://github.com/oonap0oo/small-Python-projects#lorenz_system_scipy_numpy_v2py)\nDisplaying a plot of a 3D Lorenz system solution\n\n   * [runge_kutta_python_code_exp_decay.py](https://github.com/oonap0oo/small-Python-projects#runge_kutta_python_code_exp_decaypy)\nCoding a Runge-Kutta algoritm to solve differential equations directly in Python\n\n   * [fourier_series_v4.py](https://github.com/oonap0oo/small-Python-projects#fourier_series_v4py)\nCalculating fourier series of some waveforms\n\n   * [scipy_convolution_sallen_key_lpf_v2.py](https://github.com/oonap0oo/small-Python-projects#scipy_convolution_sallen_key_lpf_v2py)\nCalculating the response in tile domain for a Sallen Key filter using convolution\n\n   * [simple_linear_regression_dataset_v2.py](https://github.com/oonap0oo/small-Python-projects#simple_linear_regression_dataset_v2py)\nLinear regression in 4 different ways, with plots\n\n   * [monte_carlo_circuit.py](https://github.com/oonap0oo/small-Python-projects#monte_carlo_circuitpy)\nExploring effect of value tolerance on a circuit using Monte Carlo, with plots\n\n   * [lotka_volterra_predator_prey_model_v2.py](https://github.com/oonap0oo/small-Python-projects#lotka_volterra_predator_prey_model_v2py)\nCalculating and plotting solution to Predetor-Prey model\n\n   * [buffons_needle_pi_approximation.py](https://github.com/oonap0oo/small-Python-projects#buffons_needle_pi_approximationpy)\nUsing Buffon's Needle to approximate pi, with plots\n\n   * [pendulum.py](https://github.com/oonap0oo/small-Python-projects#pendulumpy)\nCalculating and plotting behaviour of a pendulum solving the ODE\n\n   * [van_der_pol_oscillator.py](https://github.com/oonap0oo/small-Python-projects#van_der_pol_oscillatorpy)\nCalculating and plotting two solutions for the Van Der Pol Oscillator, solving the ODE\n\n   * [aizawa_attractor_scipy_numpy.py](https://github.com/oonap0oo/small-Python-projects#aizawa_attractor_scipy_numpypy)\nCalculating and plotting the 3D Aizawa attractor using a colorfull approach\n\n   * [nyquist_bode_nichols_plot_pid.py](https://github.com/oonap0oo/small-Python-projects#nyquist_bode_nichols_plot_pidpy)\nFor control loop with PID, calculating and plotting Nyquist, Bode and Nichols plot\n\n   * [trajectory_with_drag5.py](https://github.com/oonap0oo/small-Python-projects#trajectory_with_drag5py)\nCalculating and plotting ballistic trajectory of a projectile taking drag through the air into account\n\n   * [spirograph_offset.py](https://github.com/oonap0oo/small-Python-projects#spirograph_offsetpy)\nGenerating images as drawn by a spirograph\n  \n   * [ode_cpython.py](https://github.com/oonap0oo/small-Python-projects#ode_cpythonpy)\nSolving a given first order ODE and plotting result\n  \n   * [ode_cpython_2eq.py](https://github.com/oonap0oo/small-Python-projects#ode_cpython_2eqpy)\nSolving a set of two first order ODEs and plotting result\n  \n   * [orbits.py](https://github.com/oonap0oo/small-Python-projects#orbitspy)\nCalculating and plotting several types of orbits in 2D \"space\"\n  \n   * [durand_kerner_cpython2.py](https://github.com/oonap0oo/small-Python-projects#durand_kerner_cpython2py)\nNumerical calculation of the four solutions to a given quadratic equation\n\n   * [chua_physical5.py](https://github.com/oonap0oo/small-Python-projects#chua_physical5py)\nCalculating a response of Chua's circuit using a set of differential equations which describe a physical circuit with component values.\n\n   * [monty_hall_problem2.py](https://github.com/oonap0oo/small-Python-projects#monty_hall_problem2py)\nThe Monty Hall problem is a probability puzzle in which three closed doors are presented.\nBehind one door the price (a car) is hidden, behind the other two a goat awaits.\n\n   * [surface_3D_tkinter_v5.py](https://github.com/oonap0oo/small-Python-projects#surface_3D_tkinter_v5py)\n\n   * [electrical_field_2_charges.py](https://github.com/oonap0oo/small-Python-projects#electrical_field_2_chargespy)\n   This code assumes 2 electrical point charges and plots the electrical field and potential. The E field is shown as quiver plot, the V field as a contour plot.\n\n   * [game_of_life7.py](https://github.com/oonap0oo/small-Python-projects#game_of_life7py)\n   The classic Game of life coded using Python, tkinter and numpy\n\n   * [lissajou_text4_large.py](https://github.com/oonap0oo/small-Python-projects#lissajou_text4_largepy)\n   This code creates a Lissajou figure on a text based console. Text has to be send line per line which means the code has to figure out for each line (corresponding to an y value) which x values are part of the Lissajou figure.\n\n\n\n\n4. [Small applications and utilities](https://github.com/oonap0oo/small-Python-projects#small-applications-and-utilities)\n   * [batch_resizer.py](https://github.com/oonap0oo/small-Python-projects#batch_resizerpy)\nThis python code resizes all supported image files in a directory.\n\n   * [hex_view4.py](https://github.com/oonap0oo/small-Python-projects#hex_view4py)\nSimple console hex viewer\n\n   * [decimal_degrees_to_dms.py](https://github.com/oonap0oo/small-Python-projects#decimal_degrees_to_dmspy)\nfunction to convert decimal degrees to degrees - minutes - seconds\n\n   * [pasword_generator_v2.py](https://github.com/oonap0oo/small-Python-projects#pasword_generator_v2py)\nGenerate a password of given length containing numbers, upper case letters, lower case letters and optionally symbols\n\n   * [function_sortandfilter_v2.py](https://github.com/oonap0oo/small-Python-projects#function_sortandfilter_v2py)\nFunction which accepts a list of strings, removes duplicates, sorts alphabetically and fiters using a optional search string\n\n   * [class_color_code.py](https://github.com/oonap0oo/small-Python-projects#class_color_codepy)\n\n   * [get_color_codes.py](https://github.com/oonap0oo/small-Python-projects#get_color_codespy)\nfind the color code of a resistor using the classes in class_color_code.py prints the color bands in color on a console using ANSI escape sequences.\n\n   * [get_value_from_color_codes.py](https://github.com/oonap0oo/small-Python-projects#get_value_from_color_codespy)\nind the value and tolerance of a resistor based on the color bands. It uses the classes in class_color_code.py and prints color bands in color using ANSI escape sequences.\n\n   * [several_methods_fibonacci_sequence_v2.py](https://github.com/oonap0oo/small-Python-projects#several_methods_fibonacci_sequence_v2py)\nThese 6 different Python functions generate the same list containing a specified number of Fibonacci numbers. \n\n   * [roman_numerals_v2.py](https://github.com/oonap0oo/small-Python-projects#roman_numerals_v2py)\nThis code converts a roman numeral in standard form to an integer\n\n   * [test_machine_eps2.py](https://github.com/oonap0oo/small-Python-projects#test_machine_eps2py)\nDetermine machine epsilon through test\n\n\n## Fractals and strange attractors\n\n### [mandelbrot_v1.py](mandelbrot_v1.py)\n\n![mandelbrot_v1_image.png](mandelbrot_v1_image.png)\n\nThis code calculates a image of the Mandelbrot set, it uses numpy for vectorized calculations and\nmatplotlib for display. \n\nThis version has parameters set to view the complete Mandelbrot fractal\n\nThe image can be saved as png image file\n\n### [mandelbrot_v1_detail.py](mandelbrot_v1_detail.py)\n\n![mandelbrot_v1_detail_image.png](mandelbrot_v1_detail_image.png)\n\nThis code calculates a image of the Mandelbrot set, it uses numpy for vectorized calculations and\nmatplotlib for display. \n\nThis version has parameters set to view a detail of the Mandelbrot fractal\n\nThe image can be saved as png image file\n\n### [julia_v1.py](julia_v1.py)\n\n![julia1.png](julia1.png)\n\nA modification of the Mandelbrot code allows to calculate the Julia set.\n\n### [julia_tkinter.py](julia_tkinter.py)\n\n![julia_tkinter_screenshot1.png](julia_tkinter_screenshot1.png)\n\n![julia_tkinter_screenshot2.png](julia_tkinter_screenshot2.png)\n\nA simple approach plotting a colorful julia fractal directly on a tkinter canvas.\n\n### [julia_pil_image.py](julia_pil_image.py)\n\n![julia_pil_image_image.png](julia_pil_image_image.png)\n\nThis simple script plots a Julia fractal directly to an image which then opens in the standard image viewer. It uses the PIL (Pillow) library.\n\n### [mandelbrot_pil_image.py](mandelbrot_pil_image.py)\n\n![mandelbrot_pil_image_output.png](mandelbrot_pil_image_output.png)\n\nThis simple script plots a Mandelbrot fractal directly to an image which then opens in the standard image viewer. It uses the PIL (Pillow) library.\n\n### [logistic_map_calculate_image_v3.py](logistic_map_calculate_image_v3.py)\n\n![logistic_map_calculate_image_v3_plot.png](logistic_map_calculate_image_v3_plot.png)\n\nThis code calculates an image of the bifurcation diagram for the logistic map.\n```\n Xn+1 = a. Xn.(1 - Xn)\n```\n\nIterations are done for increasing values of 'a', the logistic map is represented as a Numpy array\n\nThe image of the map is displayed using Matplotlib and can be saved as a PNG image file.\n\n### [logistic_map_tkinter.py](logistic_map_tkinter.py)\n\n![logistic_map_tkinter_pillow_screenshot.png](logistic_map_tkinter_pillow_screenshot.png)\n\nThis simple script uses only the tkinter library which comes with CPython to display a logistic map.\n\nA slightly extended version allows to save the image as PNG file. It uses the PIL (Pillow) library which is a seperate install:\n\n[logistic_map_tkinter_pillow.py](logistic_map_tkinter_pillow.py)\n\n### [kings_dream_cpython.py](kings_dream_cpython.py)\n\n\n![kings_dream_cpython_screenshot.png\\-}-](kings_dream_cpython_screenshot.png)\n\nThis script draws the fractal defined by iterating the x,y values through the following function\n\n        x = sin(a*x) + b*sin(a*y)\n        y = sin(c*x) + d*sin(c*y)\n\nwith constants of \n\n        a = 2.879879\n        b = -0.765145\n        c = -0.966918\n        d = 0.744728\n\nand initial values of x=2, y=0 \n\nThe image can be saved as PNG file.\nThe script uses the numpy, matplotlib and math libraries.\n\n### [hopalong.py](hopalong.py)\n\n\n![hopalong_screenshot.png\\-}-](hopalong_screenshot.png)\n\nA variation of the code for the 'King's dream fractal' yields this 'hopalong' fractal.\nThis script draws the fractal defined by iterating the x,y values through the following function\n\n        x = y - 1 - sqrt(abs(bx - 1 - c)) . sign(x-1)\n        y = a - x - 1\n\nInitial values are 0.0 for x and y\nThe parameters a,b,c can be any value between 0.0 and 10.0. A lot of combinations seem to give an intresting fractal\n\n### [tinkerbell.py](tinkerbell.py)\n\n\n![tinkerbell_screenshot.png\\-}-](tinkerbell_screenshot.png)\n\nA variation of the code for the 'King's dream fractal' yields this 'tinkerbell' fractal.\nThis script draws the fractal defined by iterating the x,y values through the following function\n\n        x = x² -y² +ax + by\n        y = 2xy + cx + dy\n\nwith constants of \n\n        a = 0.9\n        b = -0.6013\n        c = 2.0\n        d = 0.5\n\nand initial values of x=0.01, y=0.01\n\nThe image can be saved as PNG file.\nThe script uses the numpy, matplotlib and math libraries.\n\n### [quadrup_two.py](quadrup_two.py)\n\n![quadrup_two_screenshot.png](quadrup_two_screenshot.png)\n\nA further variation of the code for the 'King's dream fractal' yields the 'Quadrup Two' fractal.\nThis script draws the fractal defined by iterating the x,y values through the following function\n\n        x = y - sgn(x) * sin(ln|b * x - c|) * atan( (c * xn - b)2 )\n        y = a - x\n\nwith constants for example, they can be varied to give different fractals\n\n        a = 34\n        b = 1\n        c = 5\n\nand initial values of x=0, y=0\n\nThe image can be saved as PNG file.\nThe script uses the numpy, matplotlib and math libraries.\n\n### [Gumowski_Mira.py](Gumowski_Mira.py)\n\n![Gumowski_Mira6.png](Gumowski_Mira6.png)\n\nThis Gumowski-Mira fractal seems very sensitive to parameter and intial values.\nThis script draws the fractal defined by iterating the x,y values through the following function\n\n        f(x) = ax + 2(1-a). x² / (1+x²)²\n        xn+1 = by + f(xn)\n        yn+1 = f(xn+1) - xn\n\nwith constants for example, they can be varied to give different fractals\n\n        a = -0.7  a should be within [-1,1]\n        b = 1.0 should be 1.0 (or very close?)\n\nand initial values of x=-5.5, y=-5.0, they should be in [-20,20]\n\nThe image can be saved as PNG file.\nThe script uses the numpy, matplotlib and math libraries.\n \n### [sierpinski_triangle_tkinter_v6.py](sierpinski_triangle_tkinter_v6.py)\n\n![sierpinski_triangle_tkinter_v6_screenshot.png](sierpinski_triangle_tkinter_v6_screenshot.png)\n\nSierpinski Triangle constructed using the Chaos game method. \nIt rotates and scales in and out.\nThe triangle is drawn on a tkinter canvas widget.\n\n### [pascal_triangle_ansi.py](pascal_triangle_ansi.py)\n\n![pascal_triangle.png](pascal_triangle.png)\n\nThis code calculates the first 32 rows of Pascal's triangle.\nIt then prints the last digit of each value\nby marking if that digit is uneven, the Sierpinski triangle appears.\nThis version uses ANSI escape codes to generate colors and reverse characters\n\n### [pascal_triangle_no_ansi_v2.py](pascal_triangle_no_ansi_v2.py)\n\n\nThis code calculates the first 32 rows of Pascal's triangle\nIt then prints the last digit of each value\nby marking if that digit is uneven, the Sierpinski triangle appears.\nThis version avoids using ANSI escape codes by reprinting the triangle\nusing a character in place of uneven values\n\n### [mandelbrot_text_CPython.py](mandelbrot_text_CPython.py)\n\n![mandelbrot_text_CPython_screenshot.png](mandelbrot_text_CPython_screenshot.png)\n\nThis code displays a text output of the Mandelbrot fractal. \n\nANSI commands are used to generate color.\n\nThe Mandelbrot values are displayed as 2 digit hexadecimal characters.\n\n### [mandelbrot_text_CPython_no_ansi.py](mandelbrot_text_CPython_no_ansi.py)\n\n\nA version of mandelbrot_text_CPython.py without the ANSI commands.\n\nGenerates a much more basic output witout color.\n\n### [sierpinsky_turtle_cpython.py](sierpinsky_turtle_cpython.py)\n\n\n![sierpinsky_turtle_cpython_screenshot.png](sierpinsky_turtle_cpython_screenshot.png)\n\nThis script draws a Sierpinsky triangle recursively using turtle. \n\nThis one makes use extra functionality in CPython's turtle on the PC, such as drawing filled shapes. \n\nThe code shows several triangles using  successively deeper recursion.\n\n\n### [logistic_map_test_v2.py](logistic_map_test_v2.py)\n\n![logistic_map_test_v2.jpg](logistic_map_test_v2.jpg)\n\nGenerating a bifurcation diagram of the Logistic Map.\nusing Numpy and Matplotlib\n\n### [gingerbread_CPython.py](gingerbread_CPython.py)\n\n![gingerbread_CPython_screenshot.png](gingerbread_CPython_screenshot.png)\n\nThis script draws a “Gingerbread man” fractal. The shape is generated by applying a simple iteration and plotting the x,y values. It has an extra function which keeps track of the distance between successive x,y points in the iterations, this is used to derive the color of the points to make the fractal look more interesting visually. It uses Tkinter for plotting also the math library.\n\n### [recursive_tree_canvas_v4.py](recursive_tree_canvas_v4.py)\n\n![recursive_tree_canvas_v4.png](recursive_tree_canvas_v4.png)\n \n Drawing recursive trees on a Tkinter canvas. Four different looking\n trees are drawn using the same code with different parameters.\n Function branch() draws one branch and calls function start_new_branches().\n Function start_new_branches() calls branch() three times to draw branches\n with different angles. Recursion depth is controlled by parameter number_of_recursions\n\n ### [koch_snowflake_antisnowflake.py](koch_snowflake_antisnowflake.py)\n\n![koch_snowflake_antisnowflake_recording4.gif](koch_snowflake_antisnowflake_recording4.gif)\n\nThe \u003cb\u003eKoch Snowflake and Antisnowflake\u003c/b\u003e are constructed using recursive function calls.\n\nFigures are redrawn with rising recursion depth, the snowflake and antisnowflake figures are shown.\n\nThe Code uses the Turtle Graphics library.\n\n### [rabinovich_fabrikant_system.py](rabinovich_fabrikant_system.py)\n\nThis script generates 3D plot of a solution to the Rabinovich–Fabrikant System for given parameters and initial conditions. It uses the scipy function solve_ivp() to solve the set of ODEs.\n\nWikipedia: \"The Rabinovich–Fabrikant equations are a set of three coupled ordinary differential equations exhibiting chaotic behaviour for certain values of the parameters. They are named after Mikhail Rabinovich and Anatoly Fabrikant, who described them in 1979.\"\n[https://en.wikipedia.org/wiki/Rabinovich%E2%80%93Fabrikant_equations](https://en.wikipedia.org/wiki/Rabinovich%E2%80%93Fabrikant_equations)\n\nAn example plot\n![Rabinovich–Fabrikant_System2.png](Rabinovich–Fabrikant_System2.png)\n\nRabinovich–Fabrikant System\n\n    dx/dt = y * (z - 1 + x**2) + γ * x\n    dy/dt = x * (3 * z + 1 - x**2) + γ * y\n    dz/dt = -2 * z * (α + x * y)\n\nSome more example plots:\n![Rabinovich–Fabrikant_System3.png](Rabinovich–Fabrikant_System3.png)\n\n![Rabinovich–Fabrikant_System4.png](Rabinovich–Fabrikant_System4.png)\n\n### [thomas_attractor.py](thomas_attractor.py)\n\nThis script generates 3D plot of the Thomas attractor for given parameter b and initial conditions. It uses the scipy function solve_ivp() to solve the set of ODEs.\n\nAn example plot\n![Thomas_attractor6.png](Thomas_attractor6.png)\n\n    Thomas attractor:\n\n    dx/dt = sin(y) - b * x\n    dy/dt = sin(z) - b * y\n    dz/dt = sin(x) - b * b\n\nSome more example plots:\n![Thomas_attractor.png](Thomas_attractor.png)\n\n![Thomas_attractor5.png](Thomas_attractor5.png)\n\n \n## Calculating and plotting using Numpy and Matplotlib\n\n### [pi_monte_carlo_circle.py](pi_monte_carlo_circle.py)\n\n ![pi_monte_carlo_circle_plots.png](pi_monte_carlo_circle_plots.png)\n\nMonte Carlo approximation of PI, using Python and Numpy. \nA series of points with random x,y coördinates are calculated, whether they fall inside the unit circle can be used to approximate the value of PI. Calculations are done in a series of parts called intervals. The code keeps track of the successive PI approximations taking the extra data into account after each interval, it prints a table and plots a graph. \n\n### [perimeter_ellipse_v4.py](perimeter_ellipse_v4.py)\n\n![perimeter_ellipse_v4_py.png](perimeter_ellipse_v4_py.png)\n\nThree methods to approximate the Circumference of an ellipse, using Python + Scipy + Numpy + Matplotlib\nThe Circumference of a series of elipses with identical surface area is calculated,\nthe shape ranging from a circle to the flattest ellipse.\nUsing the complete elliptic integral of the second kind function ellipe() and\nthe Binomial coefficients function binom() from scipy.special.\n\n### [wbridge.py](wbridge.py)\n\n\nCalculate output voltage of a Wheatstone Bridge as function of one\nvariable resistor Rx using Kirchhoff circuit laws and left division operator with a matrix and vector.\nMade to compare code with a GNU Octave script doing the same calculations: [wbridge.m](https://github.com/oonap0oo/GNU_Octave_scripts/blob/23891978e31cf807bc051fc30719fc4f2e71cebe/wbridge.m)\n\n### [lorenz_system_scipy_numpy_v2.py](lorenz_system_scipy_numpy_v2.py)\n\n![lorenz_system_plots_scipy_python.png](lorenz_system_plots_scipy_python.png)\n\nThis code calculates a solution for the Lorenz System with the system parameters sigma = 10, beta = 8.0 / 3.0, rho = 28.0.\nIt uses the Scipy function scipy.integrate.solve_ivp() to solve the system of ODEs. A series of plots is created using matplotlib.\nShowing the three variables x, y and z vs time and also a 3D line plot.\n\n### [runge_kutta_python_code_exp_decay.py](runge_kutta_python_code_exp_decay.py)\n\n![runge_kutta_python_code_exp_deca_plots.png](runge_kutta_python_code_exp_deca_plots.png)\n\nComparing three methods to solve a ODE:\n* First-order Euler method, coded directly in Python\n* Fourth-order Runge-Kutta method, coded directly in Python\n* Scipy function solve_ivp()\nUsing a a simple exponential decay system because it has an\nexact solution: N(t) = Nₒ.exp(-λ.t)\nComparing the results with the exact values and mesuring the execution time\nusing time.perf_counter().\nPlots are made using matplotlib.\n\n### [fourier_series_v4.py](fourier_series_v4.py)\n\n![fourier_series_plot1.png](fourier_series_plot1.png)\n\nThis code calculates the coefficients of the Fourier Series of a number\nof functions.\n* square_wave\n* pulse\n* sawtooth\n* the absolute value of a sine function\n* a chopped sine function\n* a half sine function\n\nEach function is plotted with their approximations using several numbers \nof coefficients. Also the Fourier Series coefficients themselves are plotted. \nThe code uses the function integrate.quad() from the Scipy library to calculate the various\nintegrals. The plots are made using Matplotlib, Numpy is also used.\n\n### [scipy_convolution_sallen_key_lpf_v2.py](scipy_convolution_sallen_key_lpf_v2.py)\n\n![scipy_convolution_sallen_key_lpf_v2_plot.png](scipy_convolution_sallen_key_lpf_v2_plot.png)\n\nThis code defines the transferfunction of an example VCVS Sallen-Key active analog low pass filter\nas function of s.\nIt uses the information to: \n* calculate the impulse response using Scipy function signal.impulse()  \n* calculate the frequency response using scipy function signal.bode()\n* calculate the output signal as function of time for two types of input signals. It performs a convolution of the input signals and the impulse response using scipy function signal.convolve()\n\nThe input signals are a square wave generated using Scipy function signal.square() \nand a sawtooth generated using Scipy function signal.sawtooth().\n\nGraphs are made using matplotlib. Calculations use numpy arrays.\n\n### [simple_linear_regression_dataset_v2.py](simple_linear_regression_dataset_v2.py)\n\n![simple_linear_regression_plot.png](simple_linear_regression_plot.png)\n\nThis code explores 4 different methods for simple linear regression in Python\nIt uses a function directly coded in Python:\n1. From python's statistics library: function statistics.linear_regression()\n2. From the Numpy library function numpy.polynomial.polynomial.Polynomial.fit()\n3. From the Scipy library function nscipy.stats.linregress()\n4. It plots the xy data and the linear regression lines\n\nIt displays a table using matplotlib underneath the plot \nthe test data is the duration of one swing for different lengths of a pendulum\n\n### [monte_carlo_circuit.py](monte_carlo_circuit.py)\n\n![monte_carlo_circuit_screenshot.png](monte_carlo_circuit_screenshot.png)\n\nMONTE CARLO ANALYSIS USING PYTHON, NUMPY AND MATPLOTLIB\nthis code performs a Monte Carlo analysis of a voltage divider with two resistors\nNumpy is used to generate the random values with a normal distribution\nmatplotlib is used to generate the plot\n\n### [lotka_volterra_predator_prey_model_v2.py](lotka_volterra_predator_prey_model_v2.py)\n\n![lotka_volterra_screenshot.png](lotka_volterra_screenshot.png)\n\nThis code calculates some solutions to an example Lotka–Volterra predator–prey model. \nFunction solve_ivp() is used from module Scipy to calculate solutions for 3 different initial conditions.\nThe result is plotted as function of time and in a phase-space plot using Matplotlib.\n\n### [buffons_needle_pi_approximation.py](buffons_needle_pi_approximation.py)\n\n![buffons_needle_pi_approximation_screenshot.png](buffons_needle_pi_approximation_screenshot.png)\n\nThis code uses Buffon's needle problem to approximate PI. A number of needles is randomly dropped on the floor.\nBy keeping track of the number of needles touching a set of parallel lines PI can be approximated. It is a Monte Carlo method.\n\n### [pendulum.py](pendulum.py)\n\n\n![pendulum_screenshot.png](pendulum_screenshot.png)\n\nDamped, driven pendulum\n\nThis script calculates a solution to the ODE for a driven pendulum with damping. \n\n    I*d(dθ/dt)/dt + m*g*l*sin(θ) + b*dθ/dt = a*cos(Ω*t)\n\nThis second order non linear ODE has been to be modified to a system of two first order ODEs. \n\n    dω/dt = 1/I*( -g*m/l*sin(θ) - b*ω + a*cos(Ω*t) )\n    dθ/dt = ω\n\nThe script uses a 4th order Runge-Kutta method solve_ivp() from scipy.integrate to calculate a solution of this system.\n\n### [van_der_pol_oscillator.py](van_der_pol_oscillator.py)\n\n\n![van_der_pol_oscillator_screenshot.png](van_der_pol_oscillator_screenshot.png)\n\nThis script calculates a response of a Van Der Pol Oscillator \n\n    d(d(x)/dt)/dt -  μ * (1 - x**2) * dx/dt + x = A * sin( ω*t )\n    μ: \"mu\" is non linear damping\n    x: displacement\n    A: amplitude of driving source\n    ω: angular frequency of driving source [rad/s]\n\nThe response is calculated in two cases:\n\n* Case 1: undriven with non linear damping mu=0.1\n* Case 2: oscillator with damping mu=8.53, driven with a sinewave source of amplitube A=1.2 and time period T=10s\n\nThe response is shown as function of time and as phase plot\n\n### [aizawa_attractor_scipy_numpy.py](aizawa_attractor_scipy_numpy.py)\n\n![Aizawa_Attractor_1.png](Aizawa_Attractor_1.png)\n\nThis 3D Aizawa Attractor has 6 parameters and gives a spherical appearance.\n\nCalculations done using scipy function solveivp(). Plotting done using matplotlib.\n\n### equations\n\n    dx/dt = (z - b) * x - d * y\n    dy/dt = d * x + (z - b) * y\n    dz/dt = c + a * z - z**3 / 3.0 - (x**2 + y**2) * (1 + e * z)  + f * z * x**3\n\n### Parameters of the Aizawa attractor\n\n    a = 0.95, b = 0.7, c = 0.6, d = 3.5, e = 0.25, f = 0.1\n    \n### Initial conditions\n\nx0 = 0.1, y0 = 0.0, z0 = 0.0\n\nThis alternative version shows the 3D plot only giving a larger result:\n\n![Aizawa_Attractor_2.png](Aizawa_Attractor_2.png)\n\n[aizawa_attractor_scipy_3d_only.py](aizawa_attractor_scipy_3d_only.py)\n\n\n### [nyquist_bode_nichols_plot_pid.py](nyquist_bode_nichols_plot_pid.py)\n\n![Nyquist_plot_of_control_loop.png](Nyquist_plot_of_control_loop.png)\n\n![Bode_plot_of_control_loop.png](Bode_plot_of_control_loop.png)\n\n![Nichols_plot_of_control_loop.png](Nichols_plot_of_control_loop.png)\n\nThis script defines the transferfunction of \n\n*  PID controller\n*  1e order linear system\n* 2nd order linear system\n* time delay\n\nIt calculates the open loop gain for a combination of these system with example parameters.\n\nIt plots the following graphs of the open loop gain\n\n* Nyquist plot\n* Bode plot\n* Nichols plot\n\n### [trajectory_with_drag5.py](trajectory_with_drag5.py)\n\n![trajectory_with_drag_screenshot.png](trajectory_with_drag_screenshot.png)\n\nTrajectory of a projectile with Quadratic drag.\n\n    Fdrag = k.v²\n\nSystem of equations used for numeric calculation by \nscipy.integrate function solve_ivp()\n\n    dx/dt = vx\n    dy/dt = vy\n    dvx/dt = - k/m * vx * v    \n    dvx/dt = - k/m * vx * v - g\n    \n    k/m = mu\n\nThe trajectory and velocity are plotted for a set of initial departure angles\n\n### [spirograph_offset.py](spirograph_offset.py)\n\nAanimated gif made from different graphs from this script. The GIF was made using Gimp.\n\n![Spirograph_animated.gif](Spirograph_animated.gif)\n\nThis script generates an image as made by a physical Spirograph.\n\n    x = (R - tau) * cos(t) + rho * cos( (R - tau) / tau * t )\n    y = (R - tau) * sin(t) - rho * sin( (R - tau) / tau * t )\n    \n    R: radius larger outer wheel\n    tau: radius smaller inner wheel\n    rho : distance pen from center of small wheel\n     t: polar coordinate is angle over which inner wheel\n        has travelled inside outer wheel\n    x: x coordinate of pen position\n    y: y coordinate of pen position\n\nMany parameters can be modified, yielding a different image.\n\n### [ode_cpython.py](ode_cpython.py)\n\n![ode_cpython_screenshots.gif](ode_cpython_screenshots.gif)\n\nThis script calculates a solution to a given first order ordinary differential equation.\n\n    dy/dx = f(x,y)\n\nIt also plots the slope field.\n\nthe ODE is solved using scipy function solve_ivp(). Also numpy and matplotlib are used.\n\n### [ode_cpython_2eq.py](ode_cpython_2eq.py)\n\n![ODE_2eq_screenshots.gif](ODE_2eq_screenshots.gif)\n\nThis script calculates a solution to a given set of two first order ordinary differential equations.\n\n    dy/dx = f(x,y,z)\n    dz/dx = g(x,y,z)\n\nIt plots the solution and phase plot.\n\nthe ODE is solved using scipy function solve_ivp(). Also numpy and matplotlib are used.\n\n### [orbits.py](orbits.py)\n\n![orbits_screenshot.png](orbits_screenshot.png)\n\nThis code calculates and draws some trajectories of objects around the earth in two dimensions x,y\n\n*  Geostationary orbit\n*  Elliptical orbits\n*  Hyperbolic trajectories\n\nThe orbits are calculated from the acceleration based on Newton's law of universal gravitation.\n\nNewton's law of universal gravitation\n\n    F = G * m1 * m2 / r**2\n\nOn an object in orbit\n\n    F_attraction = - G * mass_earth * mass_object / r_distance**2\n\n(F in opposite direction of r)\n\nNewton's second law of motion\n\n    F = m.a =\u003e a = F / m\n    =\u003e a_object = F_attraction / mass_object\n\nAcelleration due to gravity\n\n    =\u003e a_object = - G * mass_earth / r_distance**2\n\nThe code uses Turtle graphics for drawing.\n\nCalculations are done just using the math library.\n\n### [durand_kerner_cpython2.py](durand_kerner_cpython2.py)\n\n![durand_kerner_cpython2_screenshot1.png](durand_kerner_cpython2_screenshot1.png)\n\n![durand_kerner_cpython2_screenshot2.png](durand_kerner_cpython2_screenshot2.png)\n\n\u003cb\u003e Durand–Kerner for quadratic equations \u003c/b\u003e\n\nEquation has 4 coefficients a,b,c,d:\n\n\u003ccode\u003ex\u003csup\u003e4\u003c/sup\u003e + a * x\u003csup\u003e3\u003c/sup\u003e + b * x\u003csup\u003e2\u003c/sup\u003e + c * x + d = 0\u003c/code\u003e\n\nHas 4 roots: p,q,r,s:\n\n\u003ccode\u003e(x-p)(x-q)(x-r)(x-s) = 0\u003c/code\u003e\n\nWith f(x) defined as:\n\n\u003ccode\u003ef(x) = x\u003csup\u003e4\u003c/sup\u003e + a * x\u003csup\u003e3\u003c/sup\u003e + b * x\u003csup\u003e2\u003c/sup\u003e + c * x + d\u003c/code\u003e\n\nIterating this:\n\n\u003ccode\u003epnew = p - f(p)/[(p - q)(p - r)(p - s)]\u003cbr\u003e\nqnew = p - f(q)/[(q - pnew)(q - r)(q - s)]\u003cbr\u003e\nrnew = r - f(r)/[(r - pnew)(r - qnew)(r - s)]\u003cbr\u003e\nsnew = s - f(s)/[(s - pnew)(s - qnew)(s - rnew)]\u003cbr\u003e\u003c/code\u003e\n\nuntil p,q,r,s change less then desired precision\n\ninitial values for p,q,r,s:\n\n\u003ccode\u003ep = (0.4+0.9)\u003csup\u003e0\u003c/sup\u003e\u003cbr\u003e\nq = (0.4+0.9)\u003csup\u003e1\u003c/sup\u003e\u003cbr\u003e\nr = (0.4+0.9)\u003csup\u003e2\u003c/sup\u003e\u003cbr\u003e\ns = (0.4+0.9)\u003csup\u003e3\u003c/sup\u003e\u003cbr\u003e\u003c/code\u003e\n\n### [chua_physical5.py](chua_physical5.py)\n\n![chua_physical5_screenshot1.png](chua_physical5_screenshot1.png)\n![chua_physical5_screenshot2.png](chua_physical5_screenshot2.png)\n![chua_physical5_screenshot3.png](chua_physical5_screenshot3.png)\n\nThis script calculates a response of Chua's circuit using a set of differential equations which describe a physical circuit with component values.\n\n        il       v2                      v1      iG\n    +---\u003e---------+---------- R ---------+-------\u003e------+\n    |             |                      |              |    \n    |             v iC2                  v iC1          |    \n    |             |                      |              |    \n    L             C2                     C1             G   \n    |             |                      |              |\n    |             |                      |              |\n    |             |                      |              |    \n    +-------------+----------------------+--------------+---o Gnd\n    \nDifferential equations:\n\n    C1*dv1/dt = 1/R * (v2 - v1) - f(v1)\n    \n    C2*dv2/dt = 1/R * (v1 - v2) + il\n \n    L*dil/dt = -v2 - rs * il\n\n    v1: voltage across C1\n\n    v2: voltage across C2\n\n    il: current throught L\n\n    f: current through piecewise linear negative resistance G\n    \nG is a piecewise linear negative resistance implemented using opamp(s), also called 'Chua diode\". \n\nIt supplies energy to the circuit and provides gain and non-linearity.\n\nThe solution to the set of ODEs is calculated using scipy.integrate.solve_ivp from the scipy library.\n\nPlotting done using matplotlib.\n\nSee also:\n\n* [Chua circuit using circuit simulation software LTspice](https://github.com/oonap0oo/LTspice_analog_circuit_simulation?tab=readme-ov-file#chua_circuit_6cir)\n\n* [Chua circuit using circuit simulation software ngspice](https://github.com/oonap0oo/ngspice_analog_circuit_simulation?tab=readme-ov-file#chuas-circuit)\n\n### [monty_hall_problem2.py](monty_hall_problem2.py)\n\n![monty_hall_problem2_screenshot.png](monty_hall_problem2_screenshot.png)\n\n\u003cb\u003eMonty Hall problem simulation using Monte Carlo Method\u003c/b\u003e\n\nThe Monty Hall problem is a probability puzzle in which three closed doors are presented.\nBehind one door the price (a car) is hidden, behind the other two a goat awaits.\nA contestant chooses one of three doors, and the host, who knows where\nthe prize is (a car), opens a different door revealing a goat.\n\nThe contestant is then offered the chance to switch to\nthe remaining unopened door.\nThe correct strategy is to always switch,\nas this doubles your chances of winning the prize from 1/3 to 2/3.\n\nA Monte Carlo simulation is a computerized mathematical technique\nthat uses repeated random sampling to predict the probable outcomes\nof uncertain events, providing a range of possible results and\ntheir probabilities.\n\nThis code simulates one set of games in which the player always \nswitches his choice of doors. It simulates a second set with \nsame number of games in which the player never switches. \n\nThe number of wins is compared between the two sets\n\n### [surface_3D_tkinter_v5.py](surface_3D_tkinter_v5.py)\n\n![surface_3D_tkinter.gif](surface_3D_tkinter.gif)\n\nThis script plots 3D surfaces which are given as \n\n    z = f(x,y)\n\nIt uses only the modules math and tkinter which come with CPython.\n\n### [electrical_field_2_charges.py](electrical_field_2_charges.py)\n\n![electrical_field_2_charges_screenshot.png](electrical_field_2_charges_screenshot.png)\n\nThis code assumes 2 electrical point charges and plots the electrical field and potential.\n\nThe E field is shown as quiver plot, the V field as a contour plot.\n\nIt uses the libraries numpy and matplotlib\n\nIt is heavily inspired by the code shown in the Youtube video:\n\n\"Electrodynamics: Plotting the Potential and Electric Field for a Dipole with Python\"\n\n[https://youtu.be/cP3l6-2Z9rs?si=UqkjKmS5uvNlXhUB](https://youtu.be/cP3l6-2Z9rs?si=UqkjKmS5uvNlXhUB)\n\nThe Youtube example uses VPython, a specific library to work with vectors in Python:\n\n[https://vpython.org](https://vpython.org)\n\nThe version described here uses only numpy.\n\n### [game_of_life7.py](game_of_life7.py)\n\n\u003cb\u003eConway's Game of Life\u003c/b\u003e\n\n![game_of_life_recording2_screenshot3.png](game_of_life_recording2_screenshot3.png)\n\nThe classic Game of life coded using Python. \n\nThe graphical representation is implemented using tkinter which comes with a standard CPython installation.\n\nThe code also uses numpy for it's array support which is a seperate install.\n\nThe \"universe\" is represented in the code by a numpy array.\n\nScreenshot showing two \"gosper's guns\" these patterns create other patters called \"gliders\". \n\nCells with 2 neighbours are shown in red, cells with 3 are orange.\n\nRecording:\n[https://youtu.be/63jfOTeC7Dc?si=aUkHD4W33TaYDF15](https://youtu.be/63jfOTeC7Dc?si=aUkHD4W33TaYDF15)\n\n### [lissajou_text4_large.py](lissajou_text4_large.py)\n\n![lissajou_text4_large_animated.gif](lissajou_text4_large_animated.gif)\n\nThis code creates a Lissajou figure on a text based console. \n\nText has to be send line per line which means the code has to figure out for each line (corresponding to an y value) which x values are part of the Lissajou figure.\n\nlissajou figure with two relatibe freq. and a phase shift:\n    \n    x(t) = x_ampl * cos(fx * t)\n    y(t) = y_ampl * sin(fy * t + phase)\n\nFor a given y value, the following is used to find x values:\n\n    t1(y, k) = 1/fy * ( asin(y / y_ampl) + k * 2 * pi - phase )\n    t2(y, k) = 1/fy * ( - asin(y / y_ampl) + (1 - 2 * k) * pi - phase )\n    x1 = x_ampl * cos(fx * t1)\n    x2 = x_ampl * cos(fx * t2)\n\nk is an integer number, the number of t values needed seem to be equal to  the largest of the relative frequencies fx and fy.\n\n## Small applications and utilities\n\n### [batch_resizer.py](batch_resizer.py)\n\n![batch_resizer_screenshot.png](batch_resizer_screenshot.png)\n\nThis python code resizes all supported image files in a directory.\n\nThe resized version of the images are saved as new image files.\n\n### [hex_view4.py](hex_view4.py)\n\n![hex_view_screenshot.png](hex_view_screenshot.png)\n\nA simple hex viewer running in a console\n\n### [decimal_degrees_to_dms.py](decimal_degrees_to_dms.py)\n\n\nContains one function that takes an angle as float and returns degrees, minutes, seconds as tuple\n\nA second function takes tuple of  degrees, minutes, seconds and returns string representation   \n\n### [pasword_generator _v2.py](pasword_generator _v2.py)\n\ngenerate a password of given length containing numbers, upper case letters,\nlower case letters and optionally symbols\n\n### [function_sortandfilter_v2.py](function_sortandfilter_v2.py)\n\nfunction which accepts a list of strings, removes duplicates, sorts alphabetically\nand fiters using a optional search string\n\n### [class_color_code.py](class_color_code.py)\n\ncontains three class definitions:\n\n#### class resistor()\ncontains code to find the value of a resistor \nout of the color codes present on the component\ncan return a tuple containing (value, tolerance) as values\nor a string representation such as \"12 MOhm 5%\"\n\n#### class resistance()\ncontains code to find the colorband colors\nout of the value and tolerance of the component\nboth for sets of 4 and 5 colorbands \n\n#### class colors\ncontains dictionaries to facilitate printing in\ncolor in the console using ANSI escape sequences\n\n### [get_color_codes.py](get_color_codes.py)\n\nfind the color code of a resistor using the classes in class_color_code.py\nprints the color bands in color on a console using ANSI escape sequences.\n\n### [get_value_from_color_codes.py](get_value_from_color_codes.py)\n\nfind the value and tolerance of a resistor based on the color bands.\nIt uses the classes in class_color_code.py and prints color bands in color\nusing ANSI escape sequences.\n\n### [several_methods_fibonacci_sequence_v2.py](several_methods_fibonacci_sequence_v2.py)\n\nThese 6 different Python functions generate the same list containing a specified number of Fibonacci numbers.\nIncluded are a generator function, recursive functions with and without memoization, \na function from the sympy library and Binet's formula, a closed-form expression.\n\n### [roman_numerals_v2.py](roman_numerals_v2.py)\n\nThis code converts a roman numeral in standard form to an integer\n\n### [test_machine_eps2.py](test_machine_eps2.py)\n\nDetermine machine epsilon through test\n\nEpsilon is smallest value such that (1.0 + epsilon) is still distinguishable from 1.0 by the system\n\n(note: for numpy epsilon can also be found directly using numpy.finfo())\n\n![test_machine_eps2_screenshot.png](test_machine_eps2_screenshot.png)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foonap0oo%2Fsmall-python-projects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foonap0oo%2Fsmall-python-projects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foonap0oo%2Fsmall-python-projects/lists"}