]> Skullheadx's Git Forge - Batman.git/commitdiff
I am batman
authorSkullheadx <704277@pdsb.net>
Thu, 19 Jan 2023 22:44:19 +0000 (17:44 -0500)
committerSkullheadx <704277@pdsb.net>
Thu, 19 Jan 2023 22:44:19 +0000 (17:44 -0500)
.gitignore
README.md
batman.png [new file with mode: 0644]
main.py [new file with mode: 0644]

index d9005f2cc7fc4e65f14ed5518276007c08cf2fd0..b38c870782114ca554b72f6c6aa06cdc0be5837a 100644 (file)
@@ -1,5 +1,6 @@
 # Byte-compiled / optimized / DLL files
 __pycache__/
+.idea/
 *.py[cod]
 *$py.class
 
index aef2a57b1321c5a40e8231b022b2cb80dedd4688..ff493af632ecb0208a38f8125b7086e2c893e411 100644 (file)
--- 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 (file)
index 0000000..9cc39a8
Binary files /dev/null and b/batman.png differ
diff --git a/main.py b/main.py
new file mode 100644 (file)
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()