Here you can find the source of getSeconds(double coordinate)
Gets the (real-value) seconds component from a decimal coordinate.
Parameter | Description |
---|---|
coordinate | The decimal coordinate. |
public static double getSeconds(double coordinate)
//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)); } }