class SphereBody extends GeographicBody3D {

    @Override
    public GeographicPosition convertToPosition(Vector3d inPos, ReferenceLevel altReference)
    {
        double a = inPos.getX() * inPos.getX() + inPos.getY() * inPos.getY();
        double u = Math.sqrt(a + inPos.getZ() * inPos.getZ());

        double elevation;
        if (altReference == ReferenceLevel.ELLIPSOID)
        {
            elevation = u - getShape().getRadius();
        }
        else if (altReference == ReferenceLevel.ORIGIN)
        {
            elevation = u;
        }
        else
        {
            throw new UnexpectedEnumException(altReference);
        }

        double lat = Math.atan(inPos.getZ() / Math.sqrt(a));
        double lon = Math.atan2(inPos.getY(), inPos.getX());

        return new GeographicPosition(
                LatLonAlt.createFromDegreesMeters(Math.toDegrees(lat), Math.toDegrees(lon), elevation, altReference));
    }

    public  SphereBody(double radius);

}