Skip to content

Commit

Permalink
Merge pull request #76 from robertoduessmann/relativity-java
Browse files Browse the repository at this point in the history
Added relativity equation in Java
  • Loading branch information
BaReinhard authored Oct 4, 2017
2 parents a16e7c1 + e5911d8 commit 5eddd3d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions physics/relativity_equation/java/relativity_equation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Created by robertoduessmann on 03/10/17.
*/
public class RelativityEquation {

private static final double SPEED_LIGHT = 299792458;

public static double getEnergy(double mass) {
//E = mc2
return mass * Math.pow( SPEED_LIGHT, 2 );
}
}

0 comments on commit 5eddd3d

Please sign in to comment.