Java Utililty Methods Degree Convert to

List of utility methods to do Degree Convert to

Description

The list of methods to do Degree Convert to are organized into topic(s).

Method

String[]degreesToSexigessimal(double ra, double dec)
degrees To Sexigessimal
return new String[] { degreesToRA(ra), degreesToDEC(dec) };
StringdegreesToString(final double value, final char positiveChar, final char negativeChar)
degrees To String
if (Double.isNaN(value)) {
    return "-";
char c;
double d;
if (value < 0) {
    d = -value;
    c = negativeChar;
...
doubletoDecimalDegrees(String picaValue)
Converts coordinates in pica format to decimal degree (as used by google maps).
if (picaValue == null || picaValue.length() == 0 || (!isValid(picaValue))) {
    return 0d;
String[] strings = picaValue.split(" ");
if (strings.length < 3) {
    return 0d;
int degree = Integer.valueOf(strings[1]);
...
StringtoDegrees(double degrees, int nDecimals, boolean longitude)
to Degrees
NumberFormat degreesFormatter = NumberFormat.getInstance();
degreesFormatter.setMinimumFractionDigits(nDecimals);
degreesFormatter.setMaximumFractionDigits(nDecimals);
degreesFormatter.setMinimumIntegerDigits(longitude ? 3 : 2);
String hemisphere = longitude ? (degrees >= 0.0 ? "E" : "W") : (degrees >= 0.0 ? "N" : "S");
String degString = Integer.toString((int) Math.abs(Math.floor(degrees)));
String zeroes = "00".substring(0, (longitude ? 3 : 2) - degString.length());
degString = zeroes + degString;
...