Advertisement
Guest User

Practical 1

a guest
Oct 17th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. Cartesian to cylindrical
  2.  
  3. clc; close all;
  4. clear all; X=input('x ni');
  5. Y=input('y ni');
  6. Z=input('z ni');
  7. rho=sqrt(X^X+Y^Y) phi=atand(Y/X);
  8. Z=Z
  9. ---------------------------
  10. Cylindercal to cartesian
  11.  
  12. clc; close all;
  13. clear all; rho=input('rho ni');
  14. phi=input('fi ni');
  15. Z=input('Z ni');
  16. X=(rho*cosd(phi));
  17. Y=(rho*sind(phi)) ;
  18. Z=Z
  19.  
  20. ___________________________
  21.  
  22. Cartesian to spherical
  23.  
  24.  
  25. clc; close all; clear all;
  26. X=input('x ni');
  27. Y=input('y ni');
  28. Z=input('z ni');
  29. R=sqrt(X*X+Y*Y+Z*Z)
  30. theta=(acosd(Z/R))
  31. phi=(atand(Y/X))
  32.  
  33. ______________________
  34. Sperical to cartigen
  35.  
  36. clc;
  37. close all;
  38. clear all;
  39. R=input('R ni');
  40. theta=input('theta ni');
  41. phi=input('phi ni'); X=(R*sind(theta)*cosd(phi)) Y=(R*sind(theta)*sind(phi)); Z=(R*cosd(theta))
  42.  
  43. _______________________
  44. Cylindrical to spherical
  45.  
  46. clc;
  47. close all;
  48. clear all;
  49. rho=input('rho ni');
  50. phi=input('phi ni');
  51. z=input('z ni');
  52. x=rho*cosd(phi)
  53. y=rho*sind(phi)
  54. z=z
  55. r=sqrt(x*x+y*y+z*z)
  56. theta=acosd(z/r)
  57. phi=atand(y/x)
  58.  
  59. __________________
  60.  
  61. Spherical to cylindrical
  62.  
  63.  
  64. clc;
  65. close all;
  66. clear all;
  67. r=input('r ni');
  68. theta=input('theta ni');
  69. phi=input('phi ni');
  70. rho=(r*sind(phi))
  71. theta=theta
  72. Z=(r*cosd(phi));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement