Advertisement
Guest User

Calc 3 Lab - 2/26/15

a guest
Feb 26th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. *************************************************
  2. DUAL HELIX
  3. *************************************************
  4. syms t;
  5. t=linspace(0,4*pi,101);
  6.  
  7. x = cos(t);
  8. y = sin(t);
  9. z = t;
  10. plot3(x,y,z,'r','LineWidth',2);
  11. view([1 1 1])
  12. xlabel('x'); ylabel('y'); zlabel('z');
  13. hold on;
  14.  
  15. x = 2*cos(t);
  16. y = 2*sin(t);
  17. z = t;
  18. plot3(x,y,z,'b','LineWidth',5);
  19. view([1 1 1]);
  20. grid on;
  21.  
  22.  
  23. *************************************************
  24. Rainbow Helixes
  25. *************************************************
  26.  
  27.  
  28. syms t;
  29. t=linspace(0,4*pi,2);
  30.  
  31. x = cos(t);
  32. y = sin(t);
  33. z = t;
  34. clf;
  35. plot3(x,y,z,'r','LineWidth',2);
  36. view([1 1 1])
  37. xlabel('x'); ylabel('y'); zlabel('z');
  38. grid on;
  39. hold on;
  40.  
  41. x = 1.2*cos(t);
  42. y = 1.2*sin(t);
  43. z = t;
  44. plot3(x,y,z,'green','LineWidth',3);
  45. hold on;
  46. view([1 1 1]);
  47. grid on;
  48.  
  49. x = 1.3*cos(t);
  50. y = 1.3*sin(t);
  51. z = t;
  52. plot3(x,y,z,'yellow','LineWidth',3);
  53. hold on;
  54. view([1 1 1]);
  55. grid on;
  56.  
  57. x = 1.4*cos(t);
  58. y = 1.4*sin(t);
  59. z = t;
  60. plot3(x,y,z,'c','LineWidth',4);
  61. hold on;
  62. view([1 1 1]);
  63. grid on;
  64.  
  65. x = 1.6*cos(t);
  66. y = 1.6*sin(t);
  67. z = t;
  68. plot3(x,y,z,'m','LineWidth',4);
  69. hold on;
  70. view([1 1 1]);
  71. grid on;
  72.  
  73. x = 1.8*cos(t);
  74. y = 1.8*sin(t);
  75. z = t;
  76. plot3(x,y,z,'black','LineWidth',4);
  77. hold on;
  78. view([1 1 1]);
  79. grid on;
  80.  
  81. x = 2*cos(t);
  82. y = 2*sin(t);
  83. z = t;
  84. plot3(x,y,z,'b','LineWidth',6);
  85. hold on;
  86. view([1 1 1]);
  87. grid on;
  88.  
  89.  
  90. *************************************************
  91. Upside Down Parachute
  92. *************************************************
  93. syms x y;
  94. clf;
  95. x=linspace(-2,2,-5);
  96. y=linspace(-2,2,-5);
  97. [x,y]=meshgrid(x,y);
  98. z=x.^2+y.^2;
  99. surf(x,y,z);
  100. view([1 1 1]);
  101. xlabel('x');
  102. ylabel('y');
  103. zlabel('z');
  104. title('First Octant View of z = x^2 + y^2');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement