mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 15:16:33 -08:00
MAINT: Apply pre-commit
Remove byte-order-marker pre-commit check as there would be many adjustments necessary
This commit is contained in:
@@ -6,21 +6,23 @@
|
||||
|
||||
import math
|
||||
|
||||
|
||||
def equation(input):
|
||||
return 30 * math.exp(-input * input / 100)
|
||||
return 30 * math.exp(-input * input / 100)
|
||||
|
||||
|
||||
print(" " * 32 + "3D PLOT")
|
||||
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n\n\n\n")
|
||||
|
||||
for x in range (-300, 315, 15):
|
||||
x1 = x / 10
|
||||
l = 0
|
||||
y1 = 5 * math.floor(math.sqrt(900 - x1 * x1) / 5)
|
||||
yPlot = [" "] * 80
|
||||
for x in range(-300, 315, 15):
|
||||
x1 = x / 10
|
||||
l = 0
|
||||
y1 = 5 * math.floor(math.sqrt(900 - x1 * x1) / 5)
|
||||
yPlot = [" "] * 80
|
||||
|
||||
for y in range (y1, -(y1 + 5), -5):
|
||||
z = math.floor(25 + equation(math.sqrt(x1 * x1 + y * y)) - .7 * y)
|
||||
if z > l:
|
||||
l = z
|
||||
yPlot[z] = "*"
|
||||
print("".join(yPlot))
|
||||
for y in range(y1, -(y1 + 5), -5):
|
||||
z = math.floor(25 + equation(math.sqrt(x1 * x1 + y * y)) - 0.7 * y)
|
||||
if z > l:
|
||||
l = z
|
||||
yPlot[z] = "*"
|
||||
print("".join(yPlot))
|
||||
|
||||
Reference in New Issue
Block a user