Interpolation with curvature and tangent conditions

3 views (last 30 days)
Hello, I have two points in 3D. I wish to find an interpolating curve that has given tangents and rate of change of tangents at its end points. I attempted to use the symbolic toolbox but the answer outputs the following message:
Warning: Possibly spurious solutions. [solvelib::checkVectorSolutions] Warning: The solutions are parametrized by the symbols: u3 = R_ u4 = R_ v3 = R_ v4 = R_ x = R_ y3 = R_ y4 = R_ z1 = C_
I used solve() to try and solve for coefficients. The relevant code is as follows, where Apt2, Bpt1 are the two 3D points, ta and tb are the two tangents and dta and dtb are the two rate of change of tangents at these points. Thank you for any help offered!
% % Define polynomials or 6 coeficients
syms a1 a2 a3 b1 b2 b3 c1 c2 c3 d1 d2 d3 e1 e2 e3 f1 f2 f3 real
Rmat = [...
a1 a2 a3;...
b1 b2 b3;...
c1 c2 c3;...
d1 d2 d3;...
e1 e2 e3;...
f1 f2 f3]';
R(p) = Rmat*[p^5 p^4 p^3 p^2 p 1]';
R = R(p);
% Tangent curve
Tr(p) = sum(diff(R).^2)^-0.5*diff(R);
% Rate of change of tangent
dTr(p) = diff(Tr);
% Convert expression to symbolic function
R(p) = R;
% Use solver to solve for unknown coefs.
S = solve(...
Apt2 == R(0),...
Bpt1 == R(1),...
ta == Tr(0),...
tb == Tr(1),...
dta == dTr(0),...
dtb == dTr(1));

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!