Here you can find the source of kmToKnots(int km)
Parameter | Description |
---|---|
km | The value to convert. |
public static float kmToKnots(int km)
//package com.java2s; /**//from w w w . j a va 2 s. c om * Offers various useful methods related to geopositionning. * <p>License: This library is under the GNU Lesser General Public License</p> * * @author Praplan Christophe * @author Velen Stephane * @version 1.0 <p>Geneva, the 23.03.2006 */ public class Main { private static final double KnotsToKm = 1.852; /** * Convert kilometers into international nautical miles . * * @param km The value to convert. * @return in international nautical miles. */ public static float kmToKnots(int km) { return (float) (km / KnotsToKm); } /** * Convert kilometers into international nautical miles . * * @param km The value to convert. * @return in international nautical miles. */ public static float kmToKnots(float km) { return (float) (km / KnotsToKm); } /** * Convert kilometers into international nautical miles . * * @param km The value to convert. * @return in international nautical miles. */ public static long kmToKnots(long km) { return (long) (km / KnotsToKm); } /** * Convert kilometers into international nautical miles . * * @param km The value to convert. * @return in international nautical miles. */ public static double kmToKnots(double km) { return km / KnotsToKm; } }