Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Docs: Added code example to Mobject.get_critical_point(), fixed some broken formatting, added some links to installation guides (#1077)

Bogdan Stăncescu2f4ade628508
diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst
index b35e7280f..7d32ded27 100644
--- a/docs/source/contributing.rst
+++ b/docs/source/contributing.rst
@@ -226,8 +226,10 @@ Further useful guidelines
general as tidy as possible.
-You can find examples for the ``docs`` in many places:
-In ``Example Gallery`` , ``Tutorials`` , ``Reference Classes`` and ``Reference Modules``.
+You can find examples for the ``docs`` in several places:
+the :doc:`Example Gallery<examples>`, :doc:`Tutorials<tutorials>`,
+and :doc:`Reference Classes<reference>`.
+
In case you are contributing, please have a look at this flowchart:
.. raw:: html
diff --git a/docs/source/installation/for_dev.rst b/docs/source/installation/for_dev.rst
index 4f71f1aa8..b6b4005e1 100644
--- a/docs/source/installation/for_dev.rst
+++ b/docs/source/installation/for_dev.rst
@@ -1,9 +1,7 @@
Manim Installation For Developers
=================================
- This documentation is for developers who want to contribute to ``ManimCommunity/manim``.
-
-
+ This documentation is intended for developers who want to contribute to ``ManimCommunity/manim``.
Manim Installation For Developers with pip
******************************************
@@ -22,7 +20,7 @@ Finally, after having cloned this repo, run the following:
python3 -m pip install .
-Please see :doc:`contributing` for more details about contributing to Manim.
+Please see :doc:`our contributing guide<../contributing>` for more details about contributing to Manim.
.. warning::
diff --git a/docs/source/installation/mac.rst b/docs/source/installation/mac.rst
index e65004665..814b4f74f 100644
--- a/docs/source/installation/mac.rst
+++ b/docs/source/installation/mac.rst
@@ -14,7 +14,7 @@ it is not installed, please install it with this command (for Apple Silicon user
As of February 2020, the installation with ``brew`` has some issues with scipy and cairo packages in Apple Silicon mode. This can be solved by installing brew in the rosetta2 mode.
Therefore, a rosetta terminal needs to be created (see here: https://5balloons.info/correct-way-to-install-and-use-homebrew-on-m1-macs/). In case you installed ``brew`` in the normal terminal before, you have to make sure you are using the correct brew when installing packages. On default, the rosetta brew is located at "/usr/local/bin/brew" and the Apple Silicon brew is located at "/opt/homebrew/bin/brew" (For more details on this, visit
- https://stackoverflow.com/questions/64882584/how-to-run-the-homebrew-installer-under-rosetta-2-on-m1-macbook ). Next, install cairo, ffmpeg and mactex as described below with the rosetta brew. If not already there, install python 3.9 with ``brew install [email protected]``. Finally, make sure that you are using the right pip version to install manim, for example by running ``/usr/local/opt/[email protected]/bin/python3.9 -m pip install manim``.
+ https://stackoverflow.com/questions/64882584/how-to-run-the-homebrew-installer-under-rosetta-2-on-m1-macbook ). Next, install cairo, ffmpeg and mactex as described below with the rosetta brew. If not already there, install python 3.9 with ``brew install [email protected]``. Finally, make sure that you are using the right pip version to install manim, for example by running ``/usr/local/opt/[email protected]/bin/python3.9 -m pip install manim``.
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index b9ac7a0c5..341cf238b 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -1656,7 +1656,17 @@ class Mobject(Container):
def get_critical_point(self, direction):
"""Picture a box bounding the mobject. Such a box has
9 'critical points': 4 corners, 4 edge center, the
- center. This returns one of them.
+ center. This returns one of them, along the given direction.
+
+ ::
+
+ sample = Arc(start_angle=PI/7, angle = PI/5)
+
+ # These are all equivalent
+ max_y_1 = sample.get_top()[1]
+ max_y_2 = sample.get_critical_point(UP)[1]
+ max_y_3 = sample.get_extremum_along_dim(dim=1, key=1)
+
"""
result = np.zeros(self.dim)
all_points = self.get_points_defining_boundary()