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