Accessing Electromagnetism Constants through the Java API
The Java API defines several compile-time constant expressions, which are common for electrodynamics. These constants can be accessed in a Java macro.
star.electromagnetism.commom.ElectromagnetismConstants | ||
---|---|---|
public static final double | AVOGADRO_CONSTANT | 6.022136736E23 l/kmol |
public static final double | ELECTRIC_CONSTANT (permittivity) | 8.854187817620389E-12 F/m |
public static final double | ELEMENTARY_CHARGE | 1.602176487E-19 C |
public static final double | FARADAY_CONSTANT | 9.648525879918127E7 C/kmol |
public static final double | MAGNETIC_CONSTANT (permeability) | 1.2566370614359173E-6 H/m |
public static final double | SPEED_LIGHT | 2.99792458E8 m/s |
These constants can be invoked inside Java macros. For example, the following command can be used to access the value of the speed of light in a vacuum:
double speedOfLight = star.electromagnetism.common.ElectromagnetismConstants.SPEED_LIGHT;