Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. clc;
  2. clear all;
  3.  
  4. x=0;
  5. y=0;
  6. r=0;
  7. a=0;
  8. b=0;
  9. y1=0;
  10. y2=0;
  11. x1=0;
  12. x2=0;
  13.  
  14.  
  15. x=input('Podaj wspolrzedna x: ');
  16. y=input('Podaj wspolrzedna y: ');
  17.  
  18. r=sqrt(((x-0)^2)+((y-0)^2))
  19.  
  20.  
  21. a=input('Podaj kat przesuniecia: ');
  22.  
  23. b=x/r;
  24. b=y/r;
  25.  
  26. x1=cosd(b);
  27. y1=sind(b);
  28.  
  29. x2=x1*cosd(a)-y1*sind(a);
  30. y2=x1*sind(a)+y1*cosd(a);
  31.  
  32. A=[x2,y2]
  33.  
  34.  
  35.  
  36. clc;
  37. clear all;
  38.  
  39. x=input('Podaj x: ');
  40. y=input('Podaj y: ');
  41. z=input('Podaj z: ');
  42.  
  43. r=sqrt((x^2)+(y^2)+(z^2));
  44.  
  45. a=acos(z/r)
  46. cos(f)=(x/(sqrt(x^2+y^2)))
  47. sin(f)=(y/(sqrt(x^2+y^2)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement