<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transform(self, new_frame):
 """Change the frame of the orbit Args: new_frame (str) Return: numpy.ndarray """


        steps = self.__class__.steps(new_frame)

        orbit = self.orbit

        for _from, _to in steps:

            from_obj = _from(self.date, orbit)
            direct = "_to_%s" % _to

            if hasattr(from_obj, direct):
                rotation, offset = getattr(from_obj, direct)()
            else:
                to_obj = _to(self.date, orbit)
                inverse = "_to_%s" % _from
                if hasattr(to_obj, inverse):
                    rotation, offset = getattr(to_obj, inverse)()
                    rotation = rotation.T
                    offset = - offset
                else:
                    raise NotImplementedError("Unknown transformation {} to {}".format(_from, _to))

            if getattr(_from, "_rotation_before_translation", False):
                # In case of topocentric frame, the rotation is done before the translation
                orbit = offset + (rotation @ orbit)
            else:
                orbit = rotation @ (offset + orbit)

        return orbit