On the algorithm of latitude and longitude conversion

Source: Internet
Author: User
Tags cos sin

   PublicAngle se (Angle latA, Angle Lona, TKsoft.Earth.Angle LATB, Angle lonb) {//know two points of latitude and longitude, the method of seeking angle            DoubleCOSLATB =Math.Cos (Latb.radians); Angle TcA=TKsoft.Earth.Angle.FromRadians (Math.atan2 (Math.sin (Lona.radians-Lonb.radians) *COSLATB, Math.Cos (Lata.radians)* Math.sin (Latb.radians)-Math.sin (Lata.radians)* COSLATB *Math.Cos (Lona.radians-( Lonb.radians))); if(Tca.radians <0) Tca.radians= Tca.radians + Math.PI *2; Tca.radians= Math.PI *2-Tca.radians; returnTcA; }

The above code because of project problems, Angle is a class, you can use this code as a reference should be able to guess the approximate (Angle prefix reference by me)

 /** * According to a point, corner point (0 degrees north, the straight needle increases), distance (m) Calculate another*/         Public StaticSystem.Drawing.PointF Calpoint (DoubleXDoubleYDoubleAngelDoubledistance) {            //System.Drawing.PointF EndPoint =NewSystem.Drawing.PointF (); //the angle is converted to 0 degrees east, and the counter-clockwise increasesAngel =-angel- the+ -; //meters converted into longitude and latitude            vardis = distance/ +/111.7; //corner points to radiansAngel = Angel * Math.PI/ the; //Calculate y-coordinateEndpoint.y = (float) (Math.sin (Angel) * dis +y); //calculate x-coordinateEndpoint.x = (float) (Math.Cos (Angel) * dis +x); returnEndPoint; }

On the algorithm of latitude and longitude conversion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.