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

Code before:
        ----------
        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 based on ``range_terms``.
        """
        axis_config["length"] = length
        axis = NumberLine(range_terms, **axis_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([axis.x_min, axis.x_max])))
        return axis

    def coords_to_point(
        self, *coords: float | Sequence[float] | Sequence[Sequence[float]] | np.ndarray
    ) -> np.ndarray:
        """Accepts coordinates from the axes and returns a point with respect to the scene.
        Equivalent to `ax@(coord1)`

        Parameters
        ----------
        coords
            The coordinates. Each coord is passed as a separate argument: ``ax.coords_to_point(1, 2, 3)``.

            Also accepts a list of coordinates

            ``ax.coords_to_point( [x_0, x_1, ...], [y_0, y_1, ...], ... )``

            ``ax.coords_to_point( [[x_0, y_0, z_0], [x_1, y_1, z_1]] )``

        Returns
        -------
        np.ndarray
            A point with respect to the scene's coordinate system.
            The shape of the array will be similar to the shape of the input.

        Examples
        --------

        .. code-block:: pycon

            >>> from manim import Axes
            >>> import numpy as np

Review comment (suggestion):
```suggestion
        Equivalent to `ax @ (coord1)`
```

Code after:
                update_dict_recursively(default_config, passed_config)

    def _create_axis(
        self,
        range_terms: Sequence[float],
        axis_config: dict[str, Any],
        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 based on ``range_terms``.
        """
        axis_config["length"] = length
        axis = NumberLine(range_terms, **axis_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([axis.x_min, axis.x_max])))
        return axis

    def coords_to_point(
        self, *coords: float | Sequence[float] | Sequence[Sequence[float]] | np.ndarray
    ) -> np.ndarray:
        """Accepts coordinates from the axes and returns a point with respect to the scene.
        Equivalent to `ax @ (coord1)`

        Parameters
        ----------
        coords
            The coordinates. Each coord is passed as a separate argument: ``ax.coords_to_point(1, 2, 3)``.

            Also accepts a list of coordinates

            ``ax.coords_to_point( [x_0, x_1, ...], [y_0, y_1, ...], ... )``

            ``ax.coords_to_point( [[x_0, y_0, z_0], [x_1, y_1, z_1]] )``

        Returns
        -------