Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Docs: Fix TangentialArc example and add quadrant visualization (codeberg-mirror/#1)

TahaShamsef0cf2a34d60
diff --git a/manim/mobject/geometry/arc.py b/manim/mobject/geometry/arc.py
index d47e859c9..aa3e00800 100644
--- a/manim/mobject/geometry/arc.py
+++ b/manim/mobject/geometry/arc.py
@@ -505,9 +505,10 @@ class TangentialArc(ArcBetweenPoints):
You can choose any of the 4 possible corner arcs via the `corner` tuple.
corner = (s1, s2) where each si is ±1 to control direction along each line.
- Example
- -------
+ Examples
+ --------
.. manim:: TangentialArcExample
+ :save_last_frame:
class TangentialArcExample(Scene):
def construct(self):
@@ -518,6 +519,32 @@ class TangentialArc(ArcBetweenPoints):
arc = TangentialArc(line1, line2, radius=2.25, corner=(1, 1), color=TEAL)
self.add(arc, line1, line2)
+
+ The following example shows all four possible corner configurations:
+
+ .. manim:: TangentialArcCorners
+ :save_last_frame:
+
+ class TangentialArcCorners(Scene):
+ def construct(self):
+ # Create two intersecting lines
+ line1 = DashedLine(start=3 * LEFT, end=3 * RIGHT, color=GREY)
+ line2 = DashedLine(start=3 * UP, end=3 * DOWN, color=GREY)
+
+ # All four corner configurations with different colors
+ arc_pp = TangentialArc(line1, line2, radius=1.5, corner=(1, 1), color=RED)
+ arc_pn = TangentialArc(line1, line2, radius=1.5, corner=(1, -1), color=GREEN)
+ arc_np = TangentialArc(line1, line2, radius=1.5, corner=(-1, 1), color=BLUE)
+ arc_nn = TangentialArc(line1, line2, radius=1.5, corner=(-1, -1), color=YELLOW)
+
+ # Labels for each arc
+ label_pp = Text("(1,1)", font_size=24, color=RED).next_to(arc_pp, UR, buff=0.1)
+ label_pn = Text("(1,-1)", font_size=24, color=GREEN).next_to(arc_pn, DR, buff=0.1)
+ label_np = Text("(-1,1)", font_size=24, color=BLUE).next_to(arc_np, UL, buff=0.1)
+ label_nn = Text("(-1,-1)", font_size=24, color=YELLOW).next_to(arc_nn, DL, buff=0.1)
+
+ self.add(line1, line2, arc_pp, arc_pn, arc_np, arc_nn)
+ self.add(label_pp, label_pn, label_np, label_nn)
"""
def __init__(