blob: b925e3c72fb389efca5629020898519fa06dad2a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/*
Date: 13 Feb 2019
Name: Matthew Strapp
Student ID number: 5449340
Course number: EE1301
Term: Spring 2019
Lab/assignment number: W-Up 1
Short Program Description: Special Relativity equation tool
*/
#include <iostream>
#include <cmath>
using namespace std;
int main () {
double L,v,c;
c=3e+10;
cout << "Enter L: "; cin >> L;
cout << "Enter V: "; cin >> v;
cout << "Relative Length = " <<
L * sqrt(1-(v*v)/(c*c)) //Relativistic Equation
<< endl;
return 0;
}
|