Created
August 2, 2020 08:13
-
-
Save sukesh-ak/0ca356c16d3cced5c7893916dfced21e to your computer and use it in GitHub Desktop.
Helper functions for handling speed conversions while using GNSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static double DegreesToRadians(double degrees) | |
{ | |
return degrees * Math.PI / 180.0; | |
} | |
public static double RadiansToDegrees(double radians) | |
{ | |
return radians * 180.0 / Math.PI; | |
} | |
public static double RadiansToNauticalMiles(double radians) | |
{ | |
// There are 60 nautical miles for each degree | |
return radians * 60 * 180 / Math.PI; | |
} | |
public static double RadiansToMeters(double radians) | |
{ | |
// there are 1852 meters in a nautical mile | |
return 1852 * RadiansToNauticalMiles(radians); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment