SHARE
TWEET

Untitled

a guest Feb 20th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function [fx, fy] = interpHermite (p0, p1, m0, m1)
  2.     t = linspace(1,5);
  3.     u = (t' - t(1))./(t(end) - t(1));
  4.    
  5.     U(:, 1) = u.^3;
  6.     U(:, 2) = u.^2;
  7.     U(:, 3) = u;
  8.     U(:, 4) = 1;
  9.     A = [2 -2 1 1; -3 3 -2 -1; 0 0 1 0; 1 0 0 0];
  10.    
  11.     fx = U*A*[p0(1) p1(1) m0(1) m1(1)].';
  12.     fy = U*A*[p0(2) p1(2) m0(2) m1(2)].';
  13.    
  14.     hold on
  15.     scatter([p0(1) p1(1)], [p0(2) p1(2)], "filled");
  16.     plot(fx, fy)
  17.     hold off
  18. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top