daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. clear, clc, clf;
  2. t = (0:0.00001:1)';
  3. b = [1.0 0.72];
  4. c = [0.12 0.9];
  5. p1 = [1 0];
  6. p2 = [0 0.5];
  7.  
  8. points = [p1; b; c; p2; p1];
  9.  
  10. plot(p1(1),p1(2),'*g',p2(1),p2(2),'*r',b(1),b(2),'*black',c(1),c(2),'*b');
  11. axis equal, hold on;
  12.  
  13. A = [(1-t).^3 3*t.*(1-t).^2 3*t.^2.*(1-t) t.^3];
  14.  
  15. r = A*[p1; b; c; p2];
  16.  
  17. plot(r(:,1), r(:,2));
  18. plot(points(:,1), points(:,2), '--black');
  19.  
  20. phi = 0:0.001:pi/2;
  21. x = cos(phi).^3;
  22. f = 1.5*sin(phi)-sin(phi).^3;
  23. plot(x,f,'g');
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