Convert Degrees/Minutes/Seconds to Decimal Coordinates

前端 未结 7 1157
青春惊慌失措
青春惊慌失措 2020-12-01 12:31

In one part of my code I convert from decimal coordinates to degrees/minutes/seconds and I use this:

double coord = 59.345235;
int sec = (int)Math.Round(coor         


        
相关标签:
7条回答
  • 2020-12-01 13:23

    Try this:

    public double ConvertDegreeAngleToDouble( double degrees, double minutes, double seconds )
    {
        //Decimal degrees = 
        //   whole number of degrees, 
        //   plus minutes divided by 60, 
        //   plus seconds divided by 3600
    
        return degrees + (minutes/60) + (seconds/3600);
    }
    
    0 讨论(0)
提交回复
热议问题