Advertisement
Guest User

Untitled

a guest
Feb 5th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.80 KB | None | 0 0
  1. function [cas,cas_premica]=risi_brah(T1,T2,st_tock,brisi);
  2. %RISI_BRAH narise brahistohrono
  3. %RISI_BRAH(T1,T2,st_tock)
  4. %T1=[x_1;y1]; T_2=[x_2;y_2]
  5. %st_tock je stevilo razdelitev intervala [0,theta*]
  6. %brisi je 1, ce zelimo pobrisati sliko
  7. %vrnemo tudi cas potovanja po brahistohroni ter cas potovanja po premici
  8. %med danima tockama
  9.  
  10. if brisi==1
  11.     clf;
  12. end
  13.  
  14. %naredimo premik tock:
  15. b=T2(1)-T1(1);
  16. B=T2(2)-T1(2);
  17. [k,theta0]=isci_theta_k(b,B);
  18. theta=linspace(0,theta0,st_tock);
  19. x=1/2*k^2*(theta-sin(theta))+T1(1);
  20. y=-1/2*k^2*(1-cos(theta))+T1(2);
  21. hold on;
  22. plot(x,y,'b');
  23. plot([T1(1),T2(1)],[T1(2),T2(2)],'ro');
  24. grid;
  25. axis equal;
  26. hold off;
  27. g = 9.81;
  28. cas = sqrt(1/(2*g))*theta0*k; % čas po cikloidi
  29.  
  30. d = sqrt(b^2+B^2);
  31. a = g/sqrt(2);
  32. cas_premica = sqrt(2*d/a); % čas po premici
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement