Skip to content

Commit ae211b1

Browse files
committed
Adds comments and info to RelCalc.
1 parent 94685a1 commit ae211b1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

RelCalc/src/Main.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,24 @@
33
import java.math.BigDecimal;
44
import java.math.BigInteger;
55

6+
/*A simple calculator that computes the relativistic kinetic energy of an object using the acceleration of the object over a distance.
7+
Was intended to give a Wolfram-Alpha-like energy comparison past the point where Wolfram Alpha rounded velocity to 1c. No user input
8+
provided as I just wanted to play with the math a bit.
9+
10+
Uses a BigDecimal math library by Richard J. Mathar found here: http://arxiv.org/abs/0908.3030
11+
*/
612
public class Main
713
{
814
public static void main(String[] args)
915
{
16+
BigDecimal c = new BigDecimal("299792458"); //Speed of light
17+
18+
//Inputs to calculator
1019
BigDecimal mass = new BigDecimal(10);
11-
BigDecimal c = new BigDecimal("299792458");
1220
BigDecimal distance = new BigDecimal("600");
1321
BigDecimal acceleration = new BigDecimal(8.7*Math.pow(10,21));
22+
23+
//Energy of various energetic events/objects.
1424
BigDecimal chicxulub = new BigDecimal(5*Math.pow(10,23));
1525
BigDecimal tsar = new BigDecimal(2.092*Math.pow(10,17));
1626
BigDecimal boy = new BigDecimal(6.3*Math.pow(10,13));

0 commit comments

Comments
 (0)