Java Second Get getSeconds(double coordinate)

Here you can find the source of getSeconds(double coordinate)

Description

Gets the (real-value) seconds component from a decimal coordinate.

License

Open Source License

Parameter

Parameter Description
coordinate The decimal coordinate.

Return

The seconds.

Declaration


public static double getSeconds(double coordinate) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*www.  j  a va2s  . c o  m*/
    * <p>Gets the (real-value) seconds component from a decimal coordinate.</p>
    * @param coordinate The decimal coordinate.
    * @return The seconds.
    */

    public static double getSeconds(double coordinate) {
        return (((coordinate - getWholeDegrees(coordinate)) * 60) - getWholeMinutes(coordinate)) * 60;
    }

    /**
    * <p>Gets the integer component from a decimal coordinate.</p>
    * @param coordinate The decimal coordinate.
    * @return The degrees.
    */

    public static int getWholeDegrees(double coordinate) {
        return (int) coordinate;
    }

    /**
    * <p>Gets the minutes component from a decimal coordinate.</p>
    * @param coordinate The decimal coordinate.
    * @return The minutes.
    */

    public static int getWholeMinutes(double coordinate) {
        return (int) (((coordinate - getWholeDegrees(coordinate)) * 60));
    }
}

Related

  1. getSecondMaxInArray(float[] arr)
  2. getSecondName(String names)
  3. getSecondRDNValue(String dn)
  4. getSecondRulePart()
  5. getSeconds()
  6. getSeconds(double seconds)
  7. getSeconds(double t)
  8. getSeconds(final double DEC_DEG)
  9. getSeconds(int minutes)