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

Code before:

    .. manim:: RightAngleExample

        class RightAngleExample(Scene):
            def construct(self):
                line1 = Line( LEFT, RIGHT )
                line2 = Line( DOWN, UP )
                rightangles = [
                    RightAngle(line1, line2),
                    RightAngle(line1, line2, length=0.4, quadrant=(1,-1)),
                    RightAngle(line1, line2, length=0.5, quadrant=(-1,1), stroke_width=8),
                    RightAngle(line1, line2, length=0.7, quadrant=(-1,-1), color=RED),
                ]
                line_list = VGroup( *[VGroup() for k in range(4)] )
                for k in range(4):
                    linea = line1.copy()
                    lineb = line2.copy()
                    line_list[k].add( linea )
                    line_list[k].add( lineb )
                    line_list[k].add( rightangles[k] )
                line_list.arrange_in_grid(buff=1.5)
                self.play(
                    *[ShowCreation(
                        line_list[k][:2]
                    ) for k in range(4)]
                )
                self.wait(0.5)
                self.play(
                    LaggedStart(
                        *[ShowCreation(
                            line_list[k][2]
                        ) for k in range(4)],
                        lag_ratio=0.7
                    )
                )
                self.wait()

    """

    def __init__(self, line1, line2, length=0.3, quadrant=(1, 1), **kwargs):
        self.length = length
        self.quadrant = quadrant
        inter = line_intersection(
            [line1.get_start(), line1.get_end()], [line2.get_start(), line2.get_end()]
        )
        anchor_elbow_1 = inter + quadrant[0] * length * line1.get_unit_vector()
        anchor_elbow_2 = inter + quadrant[1] * length * line2.get_unit_vector()
        anchor_elbow_middle = (
            inter
            + quadrant[0] * length * line1.get_unit_vector()
            + quadrant[1] * length * line2.get_unit_vector()

Review comment (suggestion):
Because this animation doesn't need to be a video, we could change these (and the other examples) to just use `self.add(....)` instead of using animations (i.e. `self.play(...)`, `self.wait(...)`. This will allow the documentation to be generated more quickly. 

Code after:
class RightAngle(Angle):
    """An elbow-type mobject representing a right angle between two lines.

    Parameters
    ----------
    line1 : :class:`Line`
        The first line.
    line2 : :class:`Line`
        The second line.
    length : :class:`float`
        The length of the arms.
    **kwargs
        Further keyword arguments that are passed to the constructor of :class:`Angle`.

    Examples
    --------

    .. manim:: RightAngleExample
        :save_last_frame:

        class RightAngleExample(Scene):
            def construct(self):
                line1 = Line( LEFT, RIGHT )
                line2 = Line( DOWN, UP )
                rightangles = [
                    RightAngle(line1, line2),
                    RightAngle(line1, line2, length=0.4, quadrant=(1,-1)),
                    RightAngle(line1, line2, length=0.5, quadrant=(-1,1), stroke_width=8),
                    RightAngle(line1, line2, length=0.7, quadrant=(-1,-1), color=RED),
                ]
                line_list = VGroup( *[VGroup() for k in range(4)] )
                for k in range(4):
                    linea = line1.copy()
                    lineb = line2.copy()
                    line_list[k].add( linea )
                    line_list[k].add( lineb )
                    line_list[k].add( rightangles[k] )
                line_list.arrange_in_grid(buff=1.5)
                self.add(
                    line_list
                )

    """

    def __init__(self, line1, line2, length=None, **kwargs):
        Angle.__init__(self, line1, line2, radius=length, elbow=True, **kwargs)