Advertisement
Oxyg3Ng

koło w kwadracie w kwadracie

Jan 31st, 2020
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.29 KB | None | 0 0
  1. % koło w kwadracie w kwadracie
  2. r=2;
  3. x= [-r -r r r -r];
  4. y= [-r r r -r -r];
  5. a = [0 r 0 -r 0];
  6. b = [r 0 -r 0 r];
  7. plot(x,y,'b');
  8. hold on
  9. plot(a,b,'b');
  10. radius=sqrt(r);
  11. th = 0:pi/50:2*pi;
  12. xunit = radius * cos(th);
  13. yunit = radius * sin(th);
  14. h = plot(xunit, yunit,'r');
  15. axis off equal
  16. hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement