code: public Coordinate wgs84ToEcef( Coordinate cLL ) {
          double lambda = toRadians(cLL.y);
          double phi = toRadians(cLL.x);
          double sinLambda = sin(lambda);
          double cosLambda = cos(lambda);
          double cosPhi = cos(phi);
          double sinPhi = sin(phi);
          double N = semiMajorAxis / sqrt(1 - eccentricityP2 * pow(sinLambda, 2.0));
  
          double h = cLL.z;
          double x = (h + N) * cosLambda * cosPhi;
          double y = (h + N) * cosLambda * sinPhi;
          double z = (h + (1 - eccentricityP2) * N) * sinLambda;
          return new Coordinate(x, y, z);
      }
docs: Converts WGS84 coordinates to Earth-Centered Earth-Fixed (ECEF) coordinates.
  
  @param cLL the wgs84 coordinate.
  @return the ecef coordinate.