From: Skullheadx <704277@pdsb.net> Date: Thu, 19 Jan 2023 22:44:19 +0000 (-0500) Subject: I am batman X-Git-Url: http://git.skullheadx.com/now.html?a=commitdiff_plain;h=6d4d0a8d021cb49d1e8b72e4d9daeb19ea6417e9;p=Batman.git I am batman --- diff --git a/.gitignore b/.gitignore index d9005f2..b38c870 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Byte-compiled / optimized / DLL files __pycache__/ +.idea/ *.py[cod] *$py.class diff --git a/README.md b/README.md index aef2a57..ff493af 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ -# batman +# Batman Curve +Graphing the batman curve using matplotlib in Python. + +![batman.png](batman.png) + + +### **Equations**: +1. `2*sqrt((‑abs(abs(x)-1))*abs(3-abs(x))/((abs(x)-1)*(3-abs(x))))*(1+abs(abs(x)-3)/(abs(x)-3))*sqrt(1-(x/7)^2)+(5+0.97*(abs(x-0.5)+abs(x+0.5))-3*(abs(x-0.75)+abs(x+0.75)))*(1+abs(1-abs(x))/(1-abs(x)))` +2. `(‑3)*sqrt(1-(x/7)^2)*sqrt(abs(abs(x)-4)/(abs(x)-4))` +3. `abs(x/2)-0.0913722*x^2-3+sqrt(1-(abs(abs(x)-2)-1)^2)` +4. `(2.71052+1.5-0.5*abs(x)-1.35526*sqrt(4-(abs(x)-1)^2))*sqrt(abs(abs(x)-1)/(abs(x)-1))+0.9` + +Paste this into google to see the graph for yourself: + +```2 sqrt(-abs(abs(x)-1)abs(3-abs(x))/((abs(x)-1)(3-abs(x))))(1+abs(abs(x)-3)/(abs(x)-3))sqrt(1-(x/7)^2)+(5+0.97(abs(x-.5)+abs(x+.5))-3(abs(x-.75)+abs(x+.75)))(1+abs(1-abs(x))/(1-abs(x))),-3sqrt(1-(x/7)^2)sqrt(abs(abs(x)-4)/(abs(x)-4)),abs(x/2)-0.0913722(x^2)-3+sqrt(1-(abs(abs(x)-2)-1)^2),(2.71052+(1.5-.5abs(x))-1.35526sqrt(4-(abs(x)-1)^2))sqrt(abs(abs(x)-1)/(abs(x)-1))+0.9``` \ No newline at end of file diff --git a/batman.png b/batman.png new file mode 100644 index 0000000..9cc39a8 Binary files /dev/null and b/batman.png differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..5d464c5 --- /dev/null +++ b/main.py @@ -0,0 +1,35 @@ +import matplotlib.pyplot as plt +import numpy as np + +# so that undefined values are ignored +np.seterr(divide='ignore', invalid='ignore') + +# x-values to evaluate from [-10, 10] increasing by 0.0005 each time +x = np.arange(-10, 10, 0.0005) + +# Equations +y1 = 2 * np.sqrt((-abs(abs(x) - 1)) * abs(3 - abs(x)) / ((abs(x) - 1) * (3 - abs(x)))) * ( + 1 + abs(abs(x) - 3) / (abs(x) - 3)) * np.sqrt(1 - (x / 7) ** 2) + ( + 5 + 0.97 * (abs(x - 0.5) + abs(x + 0.5)) - 3 * (abs(x - 0.75) + abs(x + 0.75))) * ( + 1 + abs(1 - abs(x)) / (1 - abs(x))) +y2 = (-3) * np.sqrt(1 - (x / 7) ** 2) * np.sqrt(abs(abs(x) - 4) / (abs(x) - 4)) +y3 = abs(x / 2) - 0.0913722 * x ** 2 - 3 + np.sqrt(1 - (abs(abs(x) - 2) - 1) ** 2) +y4 = (2.71052 + 1.5 - 0.5 * abs(x) - 1.35526 * np.sqrt(4 - (abs(x) - 1) ** 2)) * np.sqrt(abs(abs(x) - 1) / + (abs(x) - 1)) + 0.9 +# plotting the equations on to the graph +plt.plot(x, y1, color='black') +plt.plot(x, y2, color='black') +plt.plot(x, y3, color='black') +plt.plot(x, y4, color='black') + +# Title +plt.title('Batman') + +# Save to batman.png image output +plt.savefig("batman.png", bbox_inches='tight') + +# show the graph +plt.show() + +# close it +plt.close()