### Question:
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; } Earth3D(); @Override Vector3d convertToModel(GeographicPosition inPos, Vector3d modelCenter); @Override GeographicPosition convertToPosition(Vector3d inPos, ReferenceLevel altReference); @Override Vector3d getNormalAtPosition(GeographicPosition inPos);  }### Answer:
@Test public void testConvertToModel() { final double latD = 22.5; final double lonD = 67.5; final double elevationM = 4557.75; Earth3D earth = new Earth3D(); GeographicPosition origGeo = new GeographicPosition( LatLonAlt.createFromDegreesMeters(latD, lonD, elevationM, Altitude.ReferenceLevel.ELLIPSOID)); Vector3d model = earth.convertToModel(origGeo, Vector3d.ORIGIN); GeographicPosition reGeo = earth.convertToPosition(model, ReferenceLevel.ELLIPSOID); Assert.assertTrue(MathUtil.isZero(latD - reGeo.getLatLonAlt().getLatD(), 0.00001)); Assert.assertTrue(MathUtil.isZero(lonD - reGeo.getLatLonAlt().getLonD(), 0.00001)); Assert.assertTrue(MathUtil.isZero(elevationM - reGeo.getLatLonAlt().getAltM(), 0.00001)); }