catmull_rom_spline
catmull_rom_spline(T, P)
Sample a curve that interpolates the points in P at times T
Constructs a Catmull-Rom cubic spline that passes through the points in P in order and samples it at times T
Parameters:
Name | Type | Description | Default |
---|---|---|---|
T |
(t,) numpy double array
|
Vector of query times between 0 and 1 |
required |
P |
(p,3) numpy double array
|
Matrix of points the curve is known to pass through |
required |
Returns:
Name | Type | Description |
---|---|---|
PT |
(t,3) numpy double array
|
Matrix of coordinates of the curve sampled at times in T |
Notes
The curve is assumed to be open.
Examples:
from gpytoolbox import catmull_rom_spline
P = np.array([[0.0,0.0],[1.0,1.0],[-1.0,2.0],[0.0,3.0]])
T = np.linspace(0,1,100)
PT = catmull_rom_spline(T,P)
Source code in src/gpytoolbox/catmull_rom_spline.py
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 |
|