timeseries.SpaceCurve.reparam¶
-
SpaceCurve.
reparam
(rate)[source]¶ Change time parametrization, to represent a constant change of speed. Locations, initial time, and arc-length are preserved.
Parameters: - rate : float
A (positive) ratio by which to increase the speed.
Notes
If
speed[i]
changes tospeed[i]*q[i]
, thendelta_t[i]
changes todelta_t[i]*p[i]
, wherep[i] = 1 / q[i]
.Examples
>>> tn = np.arange(0, 5*1e9, 1e9) >>> s = SpaceCurve(tn=tn, px=10.0*tn/1e9) # drive straight at 10m/s >>> s SpaceCurve with 5 entries and duration 4.000000000 >>> s.data time pos_x pos_y pos_z quality 0 0.0 0.0 0.0 0.0 -1 1000000000 1.0 10.0 0.0 0.0 -1 2000000000 2.0 20.0 0.0 0.0 -1 3000000000 3.0 30.0 0.0 0.0 -1 4000000000 4.0 40.0 0.0 0.0 -1 >>> a = s.reparam(0.5) >>> a.data time pos_x pos_y pos_z quality 0 0.0 0.0 0.0 0.0 -1 2000000000 2.0 10.0 0.0 0.0 -1 4000000000 4.0 20.0 0.0 0.0 -1 6000000000 6.0 30.0 0.0 0.0 -1 8000000000 8.0 40.0 0.0 0.0 -1 >>> a SpaceCurve with 5 entries and duration 8.000000000 >>> b = s.reparam(2.0) >>> b SpaceCurve with 5 entries and duration 2.000000000 >>> b.data time pos_x pos_y pos_z quality 0 0.0 0.0 0.0 0.0 -1 500000000 0.5 10.0 0.0 0.0 -1 1000000000 1.0 20.0 0.0 0.0 -1 1500000000 1.5 30.0 0.0 0.0 -1 2000000000 2.0 40.0 0.0 0.0 -1