Package pl.poznan.put.utility
Class AngleFormat
java.lang.Object
pl.poznan.put.utility.AngleFormat
A collection of formatting methods for angular values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
degrees
(double radians) Format an angle value given in radians.static String
degreesRoundedToHundredth
(double radians) Format an angle value given in radians.static String
degreesRoundedToOne
(double radians) Format an angle value given in radians.
-
Method Details
-
degreesRoundedToOne
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
String
with the value of input in degrees and a unicode degree symbol.
-
degreesRoundedToHundredth
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
String
with the value of input in degrees (two digits after comma precision) and a unicode degree symbol.
-
degrees
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
String
with the value of input in degrees.
-