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