Skip to content

Commit

Permalink
Adds comments and info to RelCalc.
Browse files Browse the repository at this point in the history
  • Loading branch information
luke738 committed Aug 26, 2016
1 parent 94685a1 commit ae211b1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion RelCalc/src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@
import java.math.BigDecimal;
import java.math.BigInteger;

/*A simple calculator that computes the relativistic kinetic energy of an object using the acceleration of the object over a distance.
Was intended to give a Wolfram-Alpha-like energy comparison past the point where Wolfram Alpha rounded velocity to 1c. No user input
provided as I just wanted to play with the math a bit.
Uses a BigDecimal math library by Richard J. Mathar found here: http://arxiv.org/abs/0908.3030
*/
public class Main
{
public static void main(String[] args)
{
BigDecimal c = new BigDecimal("299792458"); //Speed of light

//Inputs to calculator
BigDecimal mass = new BigDecimal(10);
BigDecimal c = new BigDecimal("299792458");
BigDecimal distance = new BigDecimal("600");
BigDecimal acceleration = new BigDecimal(8.7*Math.pow(10,21));

//Energy of various energetic events/objects.
BigDecimal chicxulub = new BigDecimal(5*Math.pow(10,23));
BigDecimal tsar = new BigDecimal(2.092*Math.pow(10,17));
BigDecimal boy = new BigDecimal(6.3*Math.pow(10,13));
Expand Down

0 comments on commit ae211b1

Please sign in to comment.