Created
June 23, 2014 20:01
-
-
Save anonymous/0eedb67914f554ee9cb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Barry-Goldman recursive algorithm for Catmull-Rom splines *) | |
L[i_, j_, \[Tau]_] := (t[j] - \[Tau])/(t[j] - t[i]) | |
P[i] + (\[Tau] - t[i])/(t[j] - t[i]) P[j] | |
L[i_, j_, | |
k_, \[Tau]_] := (t[k] - \[Tau])/(t[k] - t[i]) | |
L[i, j, \[Tau]] + (\[Tau] - t[i])/(t[k] - t[i]) L[j, k, \[Tau]] | |
S[i_, j_, \[Tau]_] := (t[j] - \[Tau])/(t[j] - t[i]) | |
L[i - 1, i, j, \[Tau]] + (\[Tau] - t[i])/(t[j] - t[i]) | |
L[j - 1, j, j + 1, \[Tau]] | |
S[1, 2, \[Tau]] /. {\[Tau] -> t[1]} // FullSimplify | |
S[1, 2, \[Tau]] /. {\[Tau] -> t[2]} // FullSimplify | |
D[S[1, 2, \[Tau]], \[Tau]] /. {\[Tau] -> t[1]} // FullSimplify | |
D[S[1, 2, \[Tau]], \[Tau]] /. {\[Tau] -> t[2]} // FullSimplify | |
P[1] | |
P[2] | |
(P[0] - P[1])/(t[0] - t[1]) + (-P[0] + P[2])/(t[0] - t[2]) + ( | |
P[1] - P[2])/(t[1] - t[2]) | |
(P[1] - P[2])/(t[1] - t[2]) + (-P[1] + P[3])/(t[1] - t[3]) + ( | |
P[2] - P[3])/(t[2] - t[3]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment