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

Code before:
        Parameters
        ----------
        point
            The point, i.e. ``RIGHT`` or ``[0, 1, 0]``.
            Also accepts a list of points as ``[RIGHT, [0, 1, 0]]``.

        Returns
        -------
        np.ndarray[float]
            The coordinates on the axes, i.e. ``[4.0, 7.0]``.
            Or a list of coordinates if `point` is a list of points.

        Examples
        --------

        .. code-block:: python

            from manim import Axes, RIGHT
            import numpy as np

            ax = Axes(x_range=[0, 10, 2])
            np.around(ax.point_to_coords(RIGHT), 2)
            # array([5.83, 0.  ])
            np.around(ax.point_to_coords([[0, 0, 1], [1, 0, 0]]), 2)
            # array([[5.  , 0.  ],
            #       [5.83, 0.  ]])


        .. manim:: PointToCoordsExample
            :save_last_frame:

            class PointToCoordsExample(Scene):
                def construct(self):
                    ax = Axes(x_range=[0, 10, 2]).add_coordinates()
                    circ = Circle(radius=0.5).shift(UR * 2)

                    # get the coordinates of the circle with respect to the axes
                    coords = np.around(ax.point_to_coords(circ.get_right()), decimals=2)

                    label = (
                        Matrix([[coords[0]], [coords[1]]]).scale(0.75).next_to(circ, RIGHT)
                    )

                    self.add(ax, circ, label, Dot(circ.get_right()))
        """
        point = np.asarray(point)
        result = np.asarray([axis.point_to_number(point) for axis in self.get_axes()])
        if point.ndim == 2:
            return result.T
        return result


Review comment (suggestion):
```suggestion
        .. code-block:: python

            >>> from manim import Axes, RIGHT
            >>> import numpy as np
            >>> ax = Axes(x_range=[0, 10, 2])
            >>> np.around(ax.point_to_coords(RIGHT), 2)
            array([5.83, 0.  ])
            >>> np.around(ax.point_to_coords([[0, 0, 1], [1, 0, 0]]), 2)
            array([[5.  , 0.  ],
                  [5.83, 0.  ]])
```

Code after:
        ----------
        point
            The point, i.e. ``RIGHT`` or ``[0, 1, 0]``.
            Also accepts a list of points as ``[RIGHT, [0, 1, 0]]``.

        Returns
        -------
        np.ndarray[float]
            The coordinates on the axes, i.e. ``[4.0, 7.0]``.
            Or a list of coordinates if `point` is a list of points.

        Examples
        --------

        .. code-block:: pycon

            >>> from manim import Axes, RIGHT
            >>> import numpy as np
            >>> ax = Axes(x_range=[0, 10, 2])
            >>> np.around(ax.point_to_coords(RIGHT), 2)
            array([5.83, 0.  ])
            >>> np.around(ax.point_to_coords([[0, 0, 1], [1, 0, 0]]), 2)
            array([[5.  , 0.  ],
                   [5.83, 0.  ]])


        .. manim:: PointToCoordsExample
            :save_last_frame:

            class PointToCoordsExample(Scene):
                def construct(self):
                    ax = Axes(x_range=[0, 10, 2]).add_coordinates()
                    circ = Circle(radius=0.5).shift(UR * 2)

                    # get the coordinates of the circle with respect to the axes
                    coords = np.around(ax.point_to_coords(circ.get_right()), decimals=2)

                    label = (
                        Matrix([[coords[0]], [coords[1]]]).scale(0.75).next_to(circ, RIGHT)
                    )

                    self.add(ax, circ, label, Dot(circ.get_right()))
        """
        point = np.asarray(point)
        result = np.asarray([axis.point_to_number(point) for axis in self.get_axes()])
        if point.ndim == 2:
            return result.T
        return result

    def get_axes(self) -> VGroup:
        """Gets the axes.