Created
November 26, 2015 01:40
-
-
Save Phyyl/6ea10b1cbcf41bb89f65 to your computer and use it in GitHub Desktop.
This file contains 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
private string CalcLatitude() | |
{ | |
float reste = (float)Math.Abs(Y - 0.5f) * 180; | |
int deg = (int)reste; | |
reste -= deg; | |
reste *= 60; | |
int min = (int)reste; | |
reste -= min; | |
reste *= 60; | |
int sec = (int)reste; | |
return string.Format("{0}° {1}' {2}\" {3}", deg, min, sec, Y > 0.5f ? "S" : "N"); | |
} | |
/// <summary> | |
/// Calcul de la longitude | |
/// </summary> | |
/// <returns>Longitude</returns> | |
private string CalcLongitude() | |
{ | |
float reste = (float)Math.Abs(X - 0.5f) * 360; | |
int deg = (int)reste; | |
reste -= deg; | |
reste *= 60; | |
int min = (int)reste; | |
reste -= min; | |
reste *= 60; | |
int sec = (int)reste; | |
return string.Format("{0}° {1}' {2}\" {3}", deg, min, sec, X > 0.5f ? "E" : "W"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment