Compare commits
No commits in common. "818c88e050c4b9acc56cb3c02a70a83c5f3cd67f" and "e41552291689aa02ba0d23774fd4d9055940b1e7" have entirely different histories.
818c88e050
...
e415522916
1 changed files with 7 additions and 15 deletions
|
@ -17,17 +17,15 @@ def berechneflugbahn(cow, xmin, xmax, ymin, ymax, startwinkel, startgeschwindigk
|
||||||
jupiter = 24
|
jupiter = 24
|
||||||
gravitation = erde
|
gravitation = erde
|
||||||
startwinkel = startwinkel * deg2rad
|
startwinkel = startwinkel * deg2rad
|
||||||
if cow.isascii():
|
cowlength = len(cow) + 1
|
||||||
cowlength = 1
|
|
||||||
else:
|
|
||||||
cowlength = 1
|
|
||||||
|
|
||||||
# Calculate time of flight, actually not used
|
# Calculate time of flight
|
||||||
flugdauer = startgeschwindigkeit * sin(startwinkel) / gravitation
|
flugdauer = startgeschwindigkeit * sin(startwinkel) / gravitation
|
||||||
|
schlafdauer = flugdauer / xmax
|
||||||
# Calculate maximum height
|
# Calculate maximum height
|
||||||
hoehe = 0.5 * gravitation * flugdauer**2 + starthoehe
|
hoehe = 0.5 * gravitation * flugdauer**2 + starthoehe
|
||||||
|
|
||||||
# calculate length of flight, actually not used
|
# calculate length of flight
|
||||||
wurfweite = (
|
wurfweite = (
|
||||||
startgeschwindigkeit
|
startgeschwindigkeit
|
||||||
* cos(startwinkel)
|
* cos(startwinkel)
|
||||||
|
@ -54,8 +52,6 @@ def berechneflugbahn(cow, xmin, xmax, ymin, ymax, startwinkel, startgeschwindigk
|
||||||
#############################################################################################
|
#############################################################################################
|
||||||
# berechneflugbahn(cow, xmin, xmax, ymin, ymax, startwinkel, startgeschwindigkeit, starthoehe):
|
# berechneflugbahn(cow, xmin, xmax, ymin, ymax, startwinkel, startgeschwindigkeit, starthoehe):
|
||||||
|
|
||||||
# some useful control
|
|
||||||
clear, home, curoff, curon = "'\x1b[2J\x1b[H", "\x1b[H", "\x1b[?25l", "\x1b[?25h"
|
|
||||||
# set position of cursor
|
# set position of cursor
|
||||||
def curpos(x, y):
|
def curpos(x, y):
|
||||||
print("\033[%d;%dH" % (ymax - y, x), end="", flush=True)
|
print("\033[%d;%dH" % (ymax - y, x), end="", flush=True)
|
||||||
|
@ -83,7 +79,6 @@ xmin = 0
|
||||||
startwinkel = 34
|
startwinkel = 34
|
||||||
startgeschwindigkeit = 31
|
startgeschwindigkeit = 31
|
||||||
starthoehe = 0
|
starthoehe = 0
|
||||||
schlafzeit = 0.05
|
|
||||||
###
|
###
|
||||||
|
|
||||||
# needed for erasing ol position
|
# needed for erasing ol position
|
||||||
|
@ -94,16 +89,13 @@ y = xmin
|
||||||
|
|
||||||
# Call the function, which calculates the coordinates)
|
# Call the function, which calculates the coordinates)
|
||||||
ergebnis = berechneflugbahn(cow, xmin, xmax, ymin, ymax, startwinkel, startgeschwindigkeit, starthoehe)
|
ergebnis = berechneflugbahn(cow, xmin, xmax, ymin, ymax, startwinkel, startgeschwindigkeit, starthoehe)
|
||||||
print(curoff)
|
|
||||||
# here we draw the cow
|
# here we draw the cow
|
||||||
for count in range(xmin, len(ergebnis), 2):
|
for count in range(xmin, len(ergebnis), 2):
|
||||||
xold, yold = x, y
|
xold, yold = x, y
|
||||||
x, y = ergebnis[count], ergebnis[count + 1]
|
x, y = ergebnis[count], ergebnis[count + 1]
|
||||||
curpos(x, y)
|
curpos(x, y)
|
||||||
print(cow, end="")
|
print(cow, end="")
|
||||||
sleep(schlafzeit)
|
|
||||||
curpos(xold, yold)
|
curpos(xold, yold)
|
||||||
print("☁️ ", end="")
|
print(".",end="")
|
||||||
|
bla = input("CR please...")
|
||||||
|
|
||||||
sys.exit(home + cow + curon)
|
|
||||||
|
|
Loading…
Reference in a new issue