Package com.irurueta.units
Class ForceConverter
java.lang.Object
com.irurueta.units.ForceConverter
Does force conversions to different units.
To prevent loss of accuracy, conversion should only be done as a final step
before displaying force measurements.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final doubleNumber of newtons in 1 dyne.(package private) static final doubleNumber of newtons in 1 kilogram-force.(package private) static final doubleNumber of newtons in 1 kilonewton.(package private) static final doubleNumber of newtons in 1 pound-force. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleConverts a force value from input unit to provided output unit.static voidConverts a force instance to provided output force unit.static voidConverts and updates a force to requested output unit.static voidConverts a force to requested output unit.static NumberConverts a force value from input unit to provided output unit.static ForceconvertAndReturnNew(Force input, ForceUnit outputUnit) Converts a force instance to requested output unit.static doubledyneToNewton(double dyne) Converts provided dynes value to newtons.static doublekilogramForceToNewton(double kilogramForce) Converts provided kilogram-force value to newtons.static doublekilonewtonToNewton(double kilonewton) Converts provided kilonewtons value to newtons.static doublenewtonToDyne(double newton) Converts provided newtons value to dynes.static doublenewtonToKilogramForce(double newton) Converts provided newtons value to kilogram-force.static doublenewtonToKilonewton(double newton) Converts provided newtons value to kilonewtons.static doublenewtonToPoundForce(double newton) Converts provided newtons value to pound-force.static doublepoundForceToNewton(double poundForce) Converts provided pound-force value to newtons.
-
Field Details
-
NEWTONS_PER_KILONEWTON
static final double NEWTONS_PER_KILONEWTONNumber of newtons in 1 kilonewton.- See Also:
-
NEWTONS_PER_POUND_FORCE
static final double NEWTONS_PER_POUND_FORCENumber of newtons in 1 pound-force.- See Also:
-
NEWTONS_PER_DYNE
static final double NEWTONS_PER_DYNENumber of newtons in 1 dyne.- See Also:
-
NEWTONS_PER_KILOGRAM_FORCE
static final double NEWTONS_PER_KILOGRAM_FORCENumber of newtons in 1 kilogram-force.- See Also:
-
-
Constructor Details
-
ForceConverter
private ForceConverter()Constructor. Prevents instantiation of helper class.
-
-
Method Details
-
convert
Converts a force instance to provided output force unit.- Parameters:
input- input force to be converted.output- output force where result will be stored containing output unit.
-
convertAndReturnNew
Converts a force instance to requested output unit.- Parameters:
input- input force to be converted.outputUnit- requested output unit.- Returns:
- converted force.
-
convert
Converts and updates a force to requested output unit.- Parameters:
force- input force to be converted and updated.outputUnit- requested output unit.
-
convert
Converts a force to requested output unit.- Parameters:
input- input force to be converted.outputUnit- requested output unit.result- force instance where result will be stored.
-
convert
Converts a force value from input unit to provided output unit.- Parameters:
input- force value.inputUnit- input force unit.outputUnit- output force unit.- Returns:
- converted force value.
-
convert
Converts a force value from input unit to provided output unit.- Parameters:
input- force value.inputUnit- input force unit.outputUnit- output force unit.- Returns:
- converted force value.
-
kilonewtonToNewton
public static double kilonewtonToNewton(double kilonewton) Converts provided kilonewtons value to newtons.- Parameters:
kilonewton- kilonewtons value.- Returns:
- same force converted to newtons.
-
newtonToKilonewton
public static double newtonToKilonewton(double newton) Converts provided newtons value to kilonewtons.- Parameters:
newton- newtons value.- Returns:
- same force converted to kilonewtons.
-
poundForceToNewton
public static double poundForceToNewton(double poundForce) Converts provided pound-force value to newtons.- Parameters:
poundForce- pound-force value.- Returns:
- same force converted to newtons.
-
newtonToPoundForce
public static double newtonToPoundForce(double newton) Converts provided newtons value to pound-force.- Parameters:
newton- newtons value.- Returns:
- same force converted to pound-force.
-
dyneToNewton
public static double dyneToNewton(double dyne) Converts provided dynes value to newtons.- Parameters:
dyne- dynes value.- Returns:
- same force converted to newtons.
-
newtonToDyne
public static double newtonToDyne(double newton) Converts provided newtons value to dynes.- Parameters:
newton- newtons value.- Returns:
- same force converted to dynes.
-
kilogramForceToNewton
public static double kilogramForceToNewton(double kilogramForce) Converts provided kilogram-force value to newtons.- Parameters:
kilogramForce- kilogram-force value.- Returns:
- same force converted to newtons.
-
newtonToKilogramForce
public static double newtonToKilogramForce(double newton) Converts provided newtons value to kilogram-force.- Parameters:
newton- newtons value.- Returns:
- same force converted to kilogram-force.
-