class SphereBody extends GeographicBody3D {

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

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

        double radius = getShape().getRadius();

        double x = radius * cosφ * cosλ;
        double y = radius * cosφ * sinλ;
        double z = radius * sinφ;

        if (inPos.getLatLonAlt().getAltM() > 0)
        {
            if (inPos.getLatLonAlt().getAltitudeReference() == ReferenceLevel.ELLIPSOID)
            {
                double scalar = 1.0 + inPos.getLatLonAlt().getAltM() / radius;
                return new Vector3d(x * scalar, y * scalar, z * scalar);
            }
            else if (inPos.getLatLonAlt().getAltitudeReference() == ReferenceLevel.ORIGIN)
            {
                return new Vector3d(x, y, z).getNormalized().multiply(inPos.getLatLonAlt().getAltM());
            }
            else
            {
                throw new UnexpectedEnumException(inPos.getLatLonAlt().getAltitudeReference());
            }
        }
        return new Vector3d(x - modelCenter.getX(), y - modelCenter.getY(), z - modelCenter.getZ());
    }

    public  SphereBody(double radius);

}