Repository: ManimCommunity/manim
File: manim/mobject/coordinate_systems.py (Python)

Code before:

    def create_axis(
        self,
        range_terms: Sequence[float],
        axis_config: dict,
        length: float,
    ) -> NumberLine:
        """Creates an axis and dynamically adjusts its position depending on where 0 is located on the line.

        Parameters
        ----------
        range_terms
            The range of the the axis : `(x_min, x_max, x_step)`.
        axis_config
            Additional parameters that are passed to :class:`NumberLine`.
        length
            The length of the axis.

        Returns
        -------
        :class:`NumberLine`
            Returns a number line with the provided x and y axis range.
        """
        new_config = merge_dicts_recursively(self.axis_config, axis_config)
        new_config["length"] = length
        axis = NumberLine(range_terms, **new_config)

        # without the call to origin_shift, graph does not exist when min > 0 or max < 0
        # shifts the axis so that 0 is centered
        axis.shift(-axis.number_to_point(self.origin_shift(range_terms)))
        return axis

    def coords_to_point(self, *coords: Sequence[float]) -> np.ndarray:
        """Transforms the vector formed from ``coords`` formed by the :class:`Axes`
        into the corresponding vector with respect to the default basis.

        Returns
        -------
        np.ndarray
            A point that results from a change of basis from the coordinate system
            defined by the :class:`Axes` to that of ``manim``'s default coordinate system
        """
        origin = self.x_axis.number_to_point(self.origin_shift(self.x_range))
        result = np.array(origin)
        for axis, coord in zip(self.get_axes(), coords):
            result += axis.number_to_point(coord) - origin
        return result

    def point_to_coords(self, point: float) -> Tuple:
        """Transforms the coordinates of the point which are with respect to ``manim``'s default
        basis into the coordinates of that point with respect to the basis defined by :class:`Axes`.

Review comment (suggestion):
This would probably be better placed under `axis_config`
```py
self.axis_config = {"include_tip": tips, "numbers_to_exclude": [0]}
```

Code after:
    def update_default_configs(default_configs, passed_configs):
        for default_config, passed_config in zip(default_configs, passed_configs):
            if passed_config is not None:
                update_dict_recursively(default_config, passed_config)

    def create_axis(
        self,
        range_terms: Sequence[float],
        axis_config: dict,
        length: float,
    ) -> NumberLine:
        """Creates an axis and dynamically adjusts its position depending on where 0 is located on the line.

        Parameters
        ----------
        range_terms
            The range of the the axis : `(x_min, x_max, x_step)`.
        axis_config
            Additional parameters that are passed to :class:`NumberLine`.
        length
            The length of the axis.

        Returns
        -------
        :class:`NumberLine`
            Returns a number line with the provided x and y axis range.
        """
        new_config = merge_dicts_recursively(self.axis_config, axis_config)
        new_config["length"] = length
        axis = NumberLine(range_terms, **new_config)

        # without the call to origin_shift, graph does not exist when min > 0 or max < 0
        # shifts the axis so that 0 is centered
        axis.shift(-axis.number_to_point(self.origin_shift(range_terms)))
        return axis

    def coords_to_point(self, *coords: Sequence[float]) -> np.ndarray:
        """Transforms the vector formed from ``coords`` formed by the :class:`Axes`
        into the corresponding vector with respect to the default basis.

        Returns
        -------
        np.ndarray
            A point that results from a change of basis from the coordinate system
            defined by the :class:`Axes` to that of ``manim``'s default coordinate system
        """
        origin = self.x_axis.number_to_point(self.origin_shift(self.x_range))
        result = np.array(origin)
        for axis, coord in zip(self.get_axes(), coords):
            result += axis.number_to_point(coord) - origin
        return result