def convert_to_local_coordinates(self, vector, origin):
        """
        Give vector in world coordinates, and convert it to object coordinates. For example, vector can be other vehicle
        position, origin could be this vehicles position. In this case, vector-origin will be transformed to ego car
        coordinates. If origin is set to 0, then no offset is applied and this API only calculates relative direction.

        In a word, for calculating **points transformation** in different coordinates, origin is required. This is
        because vectors have no origin but origin is required to define a point.
        """
        vector = np.asarray(vector) - np.asarray(origin)
        vector = LVector3(*vector, 0.)
        vector = self.origin.getRelativeVector(self.engine.origin, vector)
        project_on_x = vector[0]
        project_on_y = vector[1]
        return np.array([project_on_x, project_on_y])

        Give vector in world coordinates, and convert it to object coordinates. For example, vector can be other vehicle
        position, origin could be this vehicles position. In this case, vector-origin will be transformed to ego car
        coordinates. If origin is set to 0, then no offset is applied and this API only calculates relative direction.

        In a word, for calculating **points transformation** in different coordinates, origin is required. This is
        because vectors have no origin but origin is required to define a point.
        
metadrive/base_class/base_object.py