// // MyLatLng.m // XYSW // // Created by 周泽文 on 2021/9/23. // #import "MyLatLng.h" #define RC 6378137 #define RJ 6356725 @implementation MyLatLng - (id)init:(double)longitude latitude:(double)latitude{ self = [super init]; if (self) { self.m_LoDeg=(int)longitude; self.m_LoMin=(int)((longitude-self.m_LoDeg)*60); self.m_LoSec=(longitude-self.m_LoDeg-self.m_LoMin/60.)*3600; self.m_LaDeg=(int)latitude; self.m_LaMin=(int)((latitude-self.m_LaDeg)*60); self.m_LaSec=(latitude-self.m_LaDeg-self.m_LaMin/60.)*3600; self.m_Longitude=longitude; self.m_Latitude=latitude; self.m_RadLo=longitude*M_PI/180.; self.m_RadLa=latitude*M_PI/180.; self.Ec=RJ+(RC-RJ)*(90.-self.m_Latitude)/90.; self.Ed=self.Ec*cos(self.m_RadLa); } return self; } @end