class Earth3D extends GeographicBody3D {

    @Override
    public Vector3d convertToModel(GeographicPosition inPos, Vector3d modelCenter)
    {
        LatLonAlt lla = inPos.getLatLonAlt();
        double φ = Math.toRadians(lla.getLatD());
        double λ = Math.toRadians(lla.getLonD());
        double altM = lla.getAltM();

        double cosλ = Math.cos(λ);
        double sinλ = Math.sin(λ);
        double cosφ = Math.cos(φ);
        double sinφ = Math.sin(φ);

        Vector3d vec;
        if (inPos.getLatLonAlt().getAltitudeReference() == Altitude.ReferenceLevel.ELLIPSOID)
        {
            double denom = Math.sqrt(cosφ * cosφ + WGS84EarthConstants.ONE_MINUS_FLATTENING_SQ * sinφ * sinφ);
            double semiMajOverDenom = WGS84EarthConstants.SEMI_MAJOR_AXIS_M / denom;
            double r = (semiMajOverDenom + altM) * cosφ;
            double s = (semiMajOverDenom * WGS84EarthConstants.ONE_MINUS_FLATTENING_SQ + altM) * sinφ;
            vec = new Vector3d(r * cosλ - modelCenter.getX(), r * sinλ - modelCenter.getY(), s - modelCenter.getZ());
        }
        else if (inPos.getLatLonAlt().getAltitudeReference() == Altitude.ReferenceLevel.ORIGIN)
        {
            vec = new Vector3d(altM * cosφ * cosλ - modelCenter.getX(), altM * cosφ * sinλ - modelCenter.getY(),
                    altM * sinφ - modelCenter.getZ());
        }
        else
        {
            throw new UnexpectedEnumException(inPos.getLatLonAlt().getAltitudeReference());
        }

        return vec;
    }

    public  Earth3D();

}