Package pl.poznan.put.utility
Class AngleFormat
- java.lang.Object
-
- pl.poznan.put.utility.AngleFormat
-
public final class AngleFormat extends Object
A collection of formatting methods for angular values.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringdegrees(double radians)Format an angle value given in radians.static StringdegreesRoundedToHundredth(double radians)Format an angle value given in radians.static StringdegreesRoundedToOne(double radians)Format an angle value given in radians.
-
-
-
Method Detail
-
degreesRoundedToOne
public static String degreesRoundedToOne(double radians)
Format an angle value given in radians. The method detects NaN and infinity. Values is rounded to the nearest degree.- Parameters:
radians- Input value in radians to be formatted.- Returns:
- A
Stringwith the value of input in degrees and a unicode degree symbol.
-
degreesRoundedToHundredth
public static String degreesRoundedToHundredth(double radians)
Format an angle value given in radians. The method detects NaN and infinity. Value in degrees is displayed with two digits after comma.- Parameters:
radians- Input value in radians to be formatted.- Returns:
- A
Stringwith the value of input in degrees (two digits after comma precision) and a unicode degree symbol.
-
degrees
public static String degrees(double radians)
Format an angle value given in radians. The method uses no rounding and displays raw result ofDouble.toString().- Parameters:
radians- Input value in radians to be formatted.- Returns:
- A
Stringwith the value of input in degrees.
-
-