-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel.py
76 lines (70 loc) · 1.69 KB
/
model.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
# ds = [
# 1393427349.762955,260.5,
# 1393427349.798294,271.0,
# 1393427349.834312,287.5,
# 1393427349.869154,301.5,
# 1393427349.905518,313.0,
# 1393427349.943190,329.5,
# 1393427349.977508,333.0,
# 1393427350.012137,334.5,
# 1393427350.072420,335,
# 1393427350.107153,334.5,
# 1393427350.142865,332.5,
# 1393427350.178371,330.5,
# 1393427350.212909,325.0,
# 1393427350.249384,314.5,
# 1393427350.284305,302.5,
# 1393427350.319109,289.0,
# 1393427350.357535,275.5,
# 1393427350.397600,258.5,
# 1393427350.439761,216.5,
# 1393427350.478688,191.5,
# 1393427350.519510,165.5,
# 1393427350.558037,135.0,
# 1393427350.594701,102.0,
# 1393427350.629674,76.0,
# 1393427350.664212,45.0
# ]
ds = [
1393428577.960543,572.5,
1393428577.995835,568.5,
1393428578.030105,559.0,
1393428578.064999,548.5,
1393428578.101124,535.0,
1393428578.136100,521.0,
1393428578.171180,505.5,
1393428578.206828,487.0,
1393428578.241655,464.5,
1393428578.276841,441.5,
1393428578.312448,416.5,
1393428578.346235,385.5,
1393428578.381141,356.5,
1393428578.415847,329.0,
1393428578.450665,300.5,
1393428578.485649,272.5,
1393428578.520188,214.5,
1393428578.555150,187.0,
1393428578.590010,158.5,
1393428578.625029,130.0,
1393428578.667838,95.5,
1393428578.709072,67.0
]
start_time = ds[0]
start_pos = ds[1]
for i in range(len(ds)):
if i % 2 == 0:
ds[i] -= start_time
else:
ds[i] -= start_pos
stand_ds = []
for i in range(150):
t = i/100.0
for j in range(0,len(ds),2):
if t < ds[j] and j > 0:
pos1 = ds[j-1]
pos2 = ds[j+1]
pos = (t-ds[j-2])/(ds[j]-ds[j-2])*(pos2 - pos1) + pos1
stand_ds.append((t,pos))
break
for d in stand_ds:
print "%f\t%f"%d