Advertisement
hiddenGem

Two Events Seen From Two Frames of Reference

Aug 6th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.37 KB | None | 0 0
  1. %% Two Events Seen From Two Frames of Reference
  2. % Determines the time difference between two events in a second inertial
  3. % system
  4.  
  5. % Constants
  6. c = 3.00*10^8;                  % [m/s] Speed of Light
  7.  
  8. % Inputs and Variables
  9. x1 = input('Distance 1\n');
  10. x2 = input('Distance 2\n');
  11.  
  12. % Outputs and Equations
  13. t = sqrt(x2^2-x1^2)/c;
  14. fprintf('The time difference: %.3f s\n',t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement