Answers for "degree between two points latitude longitude c#"

C#
0

degree between two points latitude longitude c#

float lambda1 = (float)ConvertToRadians(lon1);
float lambda2 = (float)ConvertToRadians(lon2);
float fi1 = (float)ConvertToRadians(lon1);
float fi2 = (float)ConvertToRadians(lon2);

float y = Mathf.Sin(lambda2 - lambda1) * Mathf.Cos(fi2);
float x = Mathf.Cos(fi1) * Mathf.Sin(fi2) - Mathf.Sin(fi1) * Mathf.Cos(fi2) * Mathf.Cos(lambda2 - lambda1);
float degree = (float)ConvertToDegree(Mathf.Atan2(y, x));
Posted by: Guest on March-05-2020

Code answers related to "degree between two points latitude longitude c#"

C# Answers by Framework

Browse Popular Code Answers by Language