-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarathontab.py
More file actions
executable file
·109 lines (101 loc) · 2.97 KB
/
Copy pathmarathontab.py
File metadata and controls
executable file
·109 lines (101 loc) · 2.97 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
class temps:
def __init__(self,h=0,m=0,s=0):
self.t=3600*h+60*m+s
def str(self):
h=int(self.t/3600)
m=int(self.t%3600/60)
s=self.t%60
st=''
if h>0:
st=st+str(h)+' h '
if m<10:
st=st+'0'+str(m)+' m '
else:
st=st+str(m)+' m '
if s<10:
st=st+'0'+str(s)+' s'
else:
st=st+str(s)+' s'
return st
class vitesse:
def __init__(self,d,t):
self.v=3600*d/t.t
def str(self):
st=''
st=st+str(int(self.v))+'.'
d=round(self.v*100)%100
if d<10:
st=st+'0'+str(d)
else:
st=st+str(d)
st=st+' km/h'
return st
# Vitesses semi :
print('Extrapolation semi vers marathon :')
# CUSTOM : changement de range minute possible.
srng=[range(15,60),range(0,60)]
for h in [1,2]:
for m in srng[h-1]:
t=temps(h,m,0)
v=vitesse(21,t)
print(t.str(),'-',v.str(),end=' ')
t.t=int(1.05*2*t.t)
v=vitesse(42.195,t)
print('~>',t.str(),'-',v.str())
# Vitesses 10 km :
print('Extrapolation 10 km vers semi vers marathon :')
drng=[range(30,60),range(0,60)]
for h in [0,1]:
for m in drng[h]:
for s in [0,30]:
t=temps(h,m,s)
v=vitesse(10,t)
print(t.str(),'-',v.str(),end=' ')
t.t=int(1.05*21*t.t/10)
v=vitesse(21,t)
print('~>',t.str(),'-',v.str(),end=' ')
t.t=int(1.05*2*t.t)
v=vitesse(42.195,t)
print('~>',t.str(),'-',v.str())
# VMA vers 10 km :
print('VMA vers 10 km :')
for i in range(10,20): # CUSTOM : changement de range VMA possible.
for j in [0,0.5]:
vma=i+j
v.v=vma
print(v.str(),end=' - ')
t=temps()
t.t=int(3600*10/(0.92*vma))
v=vitesse(10,t)
print(t.str(),'(',v.str(),')',end=' à ')
t.t=int(3600*10/(0.90*vma))
v=vitesse(10,t)
print(t.str(),'(',v.str(),')')
# VMA vers semi :
print('VMA vers semi :')
for i in range(10,20): # CUSTOM : changement de range VMA possible.
for j in [0,0.5]:
vma=i+j
v.v=vma
print(v.str(),end=' - ')
t=temps()
t.t=int(3600*21/(0.90*vma))
v=vitesse(21,t)
print(t.str(),'(',v.str(),')',end=' à ')
t.t=int(3600*21/(0.85*vma))
v=vitesse(21,t)
print(t.str(),'(',v.str(),')')
# VMA vers marathon :
print('VMA vers marathon :')
for i in range(10,20): # CUSTOM : changement de range VMA possible.
for j in [0,0.5]:
vma=i+j
v.v=vma
print(v.str(),end=' - ')
t=temps()
t.t=int(3600*42.195/(0.85*vma))
v=vitesse(42.195,t)
print(t.str(),'(',v.str(),')',end=' à ')
t.t=int(3600*42.195/(0.80*vma))
v=vitesse(42.195,t)
print(t.str(),'(',v.str(),')')