diff options
-rw-r--r-- | src/path.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -184,10 +184,17 @@ void path_eval(path *p, double s, double *pos, double *dir, double *T, double *t *T = interp1d(s,p->s,p->T,N); *t = interp1d(s,p->s,p->t,N); + /* Technically we should be interpolating between the direction vectors + * using an algorithm like Slerp (see https://en.wikipedia.org/wiki/Slerp), + * but since we expect the direction vectors to be pretty close to each + * other, we just linearly interpolate and then normalize it. */ + dir[0] = interp1d(s,p->s,p->dx,N); dir[1] = interp1d(s,p->s,p->dy,N); dir[2] = interp1d(s,p->s,p->dz,N); + normalize(dir); + *theta0 = p->theta0; } |