-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphysique.py
More file actions
57 lines (34 loc) · 1.09 KB
/
physique.py
File metadata and controls
57 lines (34 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from math import *
import csv
f = open("résultat.cvs","a", newline="")
writer = csv.writer(f)
#les variables
h = float(input("entrez l'altitude de départ en [m] : "))
vi = float(input("entrez la vitesse initiale en [m/s] :"))
dh = 0.1 #la précision
# le code
if h > 0:
#verification
an1 = input(print(f"Le calcule va commencer avec {h} pour hauteur initiale et {vi} pour vitesse initiale, si c'est bon entrez Y sinon N : "))
if an1 == "Y":
#début du calcule
while h >= 0:
a = 667/((1335+h)**2)
da = (667/((1335+h+dh)**2))-a
v = a * dh
t = dh/v
#print(h)
#print(a)
#print(t)
#print(v, "\n")
h = h - dh
h = 0
a = 667/((1335+h)**2)
da = ((667/1335+h+dh)**2)-a
v = da * dh
t = dh/v
print(h)
print(a)
print(t)
print(v, "\n c'est fini!")
f.close()