-
Notifications
You must be signed in to change notification settings - Fork 0
/
vmaestim.py
executable file
·92 lines (82 loc) · 2.36 KB
/
vmaestim.py
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
# -*- coding: utf-8 -*-
import sys
import copy
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
tlst=input('Temps réf. (h/m/s)> ').split('/')
tref=temps(int(tlst[0]),int(tlst[1]),int(tlst[2]))
dref=int(input('Dist. ref.> '))
vref=vitesse(dref,tref)
print('Base :',dref,'@',vref,'(',tref,')')
vmalow=copy.copy(vref)
vmahgh=copy.copy(vref)
if dref==5 :
vmalow.v=vmalow.v/0.95
vmahgh.v=vmahgh.v/0.93
elif dref==10:
vmalow.v=vmalow.v/0.92
vmahgh.v=vmahgh.v/0.90
elif dref==21:
vmalow.v=vmalow.v/0.90
vmahgh.v=vmahgh.v/0.85
else:
print('Dist. réf. doit être 5, 10 ou 21 km... Sorry :-(')
sys.exit(0)
print()
print('VMA entre',vmalow,'et',vmahgh)
print()
print('Intervalle vitesse fractionnés courts(1) (100% VMA) :',vmalow,'à',vmahgh)
vfraclow=copy.copy(vmalow)
vfraclow.v=vfraclow.v*0.95
vfrachgh=copy.copy(vmahgh)
vfrachgh.v=vfrachgh.v*0.95
print('Intervalle vitesse fractionnés semi-longs(2) (95% VMA) :',vfraclow,'à',vfrachgh)
vfraclow=copy.copy(vmalow)
vfraclow.v=vfraclow.v*0.85
vfrachgh=copy.copy(vmahgh)
vfrachgh.v=vfrachgh.v*0.85
print('Intervalle vitesse fractionnés longs(3) (85% VMA) :',vfraclow,'à',vfrachgh)
print()
print('(1) intervalles rapides de 30 s à 1 min.')
print('(2) intervalles rapides de 400 m à 1 km.')
print('(3) intervalles rapides de 6 à 15 min.')
print()
print('Fenêtre marathon : ',end='')
tmarlow=temps()
tmarlow.t=int(3600*42.195/(0.85*vmahgh.v))
vmarhgh=vitesse(42.195,tmarlow)
print(tmarlow,'(',vmarhgh,')',end=' à ')
tmarhgh=temps()
tmarhgh.t=int(3600*42.195/(0.80*vmalow.v))
vmarlow=vitesse(42.195,tmarhgh)
print(tmarhgh,'(',vmarlow,')')