Package org.orekit.utils.units
Class UnitsConverter
- java.lang.Object
-
- org.orekit.utils.units.UnitsConverter
-
public class UnitsConverter extends Object
Converter between units.Instances of this class are immutable.
- Since:
- 11.0
- Author:
- Luc Maisonobe
-
-
Field Summary
Fields Modifier and Type Field Description static UnitsConverter
ARC_SECONDS_TO_RADIANS
Arcseconds to radians converter.static UnitsConverter
DAYS_TO_SECONDS
Days to seconds converter.static UnitsConverter
IDENTITY
Identity converter.static UnitsConverter
KILOMETRES_2_TO_METRES_2
Square kilometres to square metres converter.static UnitsConverter
KILOMETRES_TO_METRES
Kilometres to metres converter.static UnitsConverter
KM3_P_S2_TO_M3_P_S2
km³/s² to m³/s² converter.static UnitsConverter
MILLI_ARC_SECONDS_TO_RADIANS
Milli arcseconds to radians converter.static UnitsConverter
MILLI_SECONDS_TO_SECONDS
Milli seconds to seconds converter.static UnitsConverter
NANO_TESLAS_TO_TESLAS
Nano Teslas to Tesla converter.static UnitsConverter
PERCENTS_TO_UNIT
Percents to units converter.
-
Constructor Summary
Constructors Constructor Description UnitsConverter(Unit from, Unit to)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
convert(double value)
Convert a value.Unit
getFrom()
Get the source unit.Unit
getTo()
Get the destination unit.String
toString()
-
-
-
Field Detail
-
IDENTITY
public static final UnitsConverter IDENTITY
Identity converter.
-
PERCENTS_TO_UNIT
public static final UnitsConverter PERCENTS_TO_UNIT
Percents to units converter.
-
ARC_SECONDS_TO_RADIANS
public static final UnitsConverter ARC_SECONDS_TO_RADIANS
Arcseconds to radians converter.
-
MILLI_ARC_SECONDS_TO_RADIANS
public static final UnitsConverter MILLI_ARC_SECONDS_TO_RADIANS
Milli arcseconds to radians converter.
-
MILLI_SECONDS_TO_SECONDS
public static final UnitsConverter MILLI_SECONDS_TO_SECONDS
Milli seconds to seconds converter.
-
NANO_TESLAS_TO_TESLAS
public static final UnitsConverter NANO_TESLAS_TO_TESLAS
Nano Teslas to Tesla converter.
-
DAYS_TO_SECONDS
public static final UnitsConverter DAYS_TO_SECONDS
Days to seconds converter.
-
KILOMETRES_TO_METRES
public static final UnitsConverter KILOMETRES_TO_METRES
Kilometres to metres converter.
-
KILOMETRES_2_TO_METRES_2
public static final UnitsConverter KILOMETRES_2_TO_METRES_2
Square kilometres to square metres converter.
-
KM3_P_S2_TO_M3_P_S2
public static final UnitsConverter KM3_P_S2_TO_M3_P_S2
km³/s² to m³/s² converter.
-
-
Method Detail
-
getFrom
public Unit getFrom()
Get the source unit.- Returns:
- source unit
-
getTo
public Unit getTo()
Get the destination unit.- Returns:
- destination unit
-
convert
public double convert(double value)
Convert a value.- Parameters:
value
- value in thesource unit
- Returns:
- value converted in the
destination unit
-
-