Skip to content

Commit 8bb28aa

Browse files
chopan050behackl
andauthored
Draw more accurate circular Arcs for larger angles (#4034)
Co-authored-by: Benjamin Hackl <[email protected]>
1 parent bad88a1 commit 8bb28aa

File tree

188 files changed

+3
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+3
-2
lines changed

manim/mobject/geometry/arc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,9 @@ def _set_pre_positioned_points(self) -> None:
394394
tangent_vectors[:, 1] = anchors[:, 0]
395395
tangent_vectors[:, 0] = -anchors[:, 1]
396396
# Use tangent vectors to deduce anchors
397-
handles1 = anchors[:-1] + (d_theta / 3) * tangent_vectors[:-1]
398-
handles2 = anchors[1:] - (d_theta / 3) * tangent_vectors[1:]
397+
factor = 4 / 3 * np.tan(d_theta / 4)
398+
handles1 = anchors[:-1] + factor * tangent_vectors[:-1]
399+
handles2 = anchors[1:] - factor * tangent_vectors[1:]
399400
self.set_anchors_and_handles(anchors[:-1], handles1, handles2, anchors[1:])
400401

401402
def get_arc_center(self, warning: bool = True) -> Point3D:
-83 Bytes
Binary file not shown.
-160 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
-100 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
15 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)