'Convert coordinates to another representation.
If the instance is of the requested class, it is returned unmodified.
By default, conversion is done via cartesian coordinates.
Parameters
other_class : `~astropy.coordinates.BaseRepresentation` subclass
The type of representation to turn the coordinates into.
base : instance of ``self.base_representation``, optional
Base relative to which the differentials are defined.  If the other
class is a differential representation, the base will be converted
to its ``base_representation``.'

def represent_as(self, other_class, base):

    if (other_class is self.__class__):
        return self
    self_cartesian = self.to_cartesian(base)
    if issubclass(other_class, BaseDifferential):
        base = base.represent_as(other_class.base_representation)
        return other_class.from_cartesian(self_cartesian, base)
    else:
        return other_class.from_cartesian(self_cartesian)
