Guest User

Untitled

a guest
Jul 12th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  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');
Add Comment
Please, Sign In to add comment