public static String WGS84toECEF(double latitude, double longitude, double height)
{
double X;
double Y;
double Z;
double a = 6378137.0;
double b = 6356752.31424518;
double E = (a * a - b * b) / (a * a);
double COSLAT = Math.cos(latitude * Math.PI / 180);
double SINLAT = Math.sin(latitude * Math.PI / 180);
double COSLONG = Math.cos(longitude * Math.PI / 180);
double SINLONG = Math.sin(longitude * Math.PI / 180);
double N = a / (Math.sqrt(1 - E * SINLAT * SINLAT));
double NH = N + height;
X = NH * COSLAT * COSLONG;
Y = NH * COSLAT * SINLONG;
Z = (b * b * N / (a * a) + height) * SINLAT;
return X + "," + Y + "," + Z;
}
public static String ECEFtoWGS84(double x, double y, double z)
{<