public class AngleUtilities
extends java.lang.Object
Constructor and Description |
---|
AngleUtilities() |
Modifier and Type | Method and Description |
---|---|
static double |
convert(double value,
Angle from,
Angle to)
/**
|
static java.lang.String |
format(double value)
Wrap degree value to range 1 - 360 and add degree sign
|
static java.lang.String |
format(double value,
Angle units) |
static java.lang.String |
format(double value,
Angle from,
Angle to) |
static java.lang.String |
format(double value,
Angle from,
Angle to,
boolean isBearing) |
static java.lang.String |
format(double value,
Angle from,
Angle to,
int decimalPoints) |
static java.lang.String |
format(double value,
Angle units,
boolean isBearing) |
static java.lang.String |
format(double value,
Angle units,
int decimalPoints) |
static java.lang.String |
format(double value,
int decimalPoints) |
static java.lang.String |
formatNoUnitsNoDecimal(double value,
Angle from,
Angle to) |
static int |
roundDeg(double deg)
Return rounded degree value
|
static int |
roundDeg(double deg,
boolean isBearing)
Return rounded degree value
|
static double |
roundDeg(double deg,
int dec)
Return rounded degree value
|
static double |
roundDeg(double deg,
int dec,
boolean isBearing)
Return rounded degree value
|
static double |
wrapDeg(double deg)
Wrap degree value to range
|
public static java.lang.String format(double value)
value
- Angle degree valuepublic static java.lang.String format(double value, Angle units)
value
- The value as a raw numberunits
- The unit unit for the raw numberpublic static java.lang.String format(double value, Angle units, boolean isBearing)
value
- The value as a raw numberunits
- The unit unit for the raw numberisBearing
- if the value is used for bearing 1-360 for the range (isBearing = true)public static java.lang.String format(double value, Angle from, Angle to)
value
- The value as a raw numberfrom
- The unit unit for the raw numberto
- is the unit to convert to prior to formatting.public static java.lang.String formatNoUnitsNoDecimal(double value, Angle from, Angle to)
value
- The value as a raw numberfrom
- The unit unit for the raw numberto
- is the unit to convert to prior to formatting.public static java.lang.String format(double value, Angle from, Angle to, boolean isBearing)
value
- a value as a raw numberfrom
- the unit for the valueto
- the units to convert to prior to formattingisBearing
- if the unit is used for bearingpublic static java.lang.String format(double value, int decimalPoints)
value
- a raw number in Angle.DEGREEdecimalPoints
- the number of decimal points to use when formattingpublic static java.lang.String format(double value, Angle units, int decimalPoints)
value
- a raw number described by the unitsunits
- The unit describing the valuedecimalPoints
- the number of decimal points to use when formattingpublic static java.lang.String format(double value, Angle from, Angle to, int decimalPoints)
value
- a raw number describe by the supplied from fieldfrom
- the units describing the valueto
- the unit to convert to prior to formattingdecimalPoints
- the number of decimal points to use during formatting where it is no
greater than 4.public static double convert(double value, Angle from, Angle to)
value
- a raw number describe by the supplied from fieldfrom
- the units describing the valueto
- the unit to convert to prior to formattingpublic static double wrapDeg(double deg)
deg
- Degree valuepublic static double roundDeg(double deg, int dec, boolean isBearing)
deg
- Degree valuedec
- Number of decimal places to round topublic static double roundDeg(double deg, int dec)
deg
- Degree valuedec
- Number of decimal places to round topublic static int roundDeg(double deg, boolean isBearing)
deg
- Degree valueisBearing
- 1-360 for the range (isBearing = true)public static int roundDeg(double deg)
deg
- Degree value