Compass animations

class manim_extensions.compass.MoveNiddleTipTo(compass, point=None, **kwargs)[source]

Bases: ApplyMethod

Compass-and-straightedge animation: move the compass so that its needle tip is placed at point.

Example: MoveNiddleTipToDocExample

from manim import *
from manim_extensions.compass import Compass, MoveNiddleTipTo

class MoveNiddleTipToDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(MoveNiddleTipTo(compass, ORIGIN))
        self.wait()
from manim import *
from manim_extensions.compass import Compass, MoveNiddleTipTo

class MoveNiddleTipToDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(MoveNiddleTipTo(compass, ORIGIN))
        self.wait()

__init__(compass, point=None, **kwargs)[source]

Compass-and-straightedge animation: move the compass so that its needle tip is placed at point.

Parameters:
  • compass (Compass) – The compass.

  • point (Point) – The target point.

class manim_extensions.compass.RotateCompass(compass, angle=None, **kwargs)[source]

Bases: Rotate

Compass-and-straightedge animation: rotate the compass around its needle tip by angle.

Example: RotateCompassDocExample

from manim import *
from manim_extensions.compass import Compass, RotateCompass

class RotateCompassDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(RotateCompass(compass, PI / 2))
        self.wait()
from manim import *
from manim_extensions.compass import Compass, RotateCompass

class RotateCompassDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(RotateCompass(compass, PI / 2))
        self.wait()

__init__(compass, angle=None, **kwargs)[source]

Compass-and-straightedge animation: rotate the compass around its needle tip by angle.

Parameters:
  • compass (Compass) – The compass.

  • angle (float) – The rotation angle.

class manim_extensions.compass.SplitCompass(compass, span=None, **kwargs)[source]

Bases: AnimationGroup

Compass-and-straightedge animation: rotate the two legs of the compass

Example: SplitCompassDocExample

from manim import *
from manim_extensions.compass import Compass, SplitCompass

class SplitCompassDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(SplitCompass(compass, 2))
        self.wait()
from manim import *
from manim_extensions.compass import Compass, SplitCompass

class SplitCompassDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(SplitCompass(compass, 2))
        self.wait()

__init__(compass, span=None, **kwargs)[source]

Compass-and-straightedge animation: rotate the two legs of the compass uniformly outward (or inward) so that the distance between the tips is span. The niddle_tip stays fixed.

Parameters:
  • compass (Compass) – The compass.

  • span (float) – The distance between the two compass tips.

class manim_extensions.compass.PutCompass(compass, niddle_pos=None, pen_pos=None, **kwargs)[source]

Bases: ApplyMethod

Compass-and-straightedge animation: place the compass’s niddle_tip and pen_tip at the given positions.

Example: PutCompassDocExample

from manim import *
from manim_extensions.compass import Compass, PutCompass

class PutCompassDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(PutCompass(compass, ORIGIN, 2 * RIGHT))
        self.wait()
from manim import *
from manim_extensions.compass import Compass, PutCompass

class PutCompassDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(PutCompass(compass, ORIGIN, 2 * RIGHT))
        self.wait()

__init__(compass, niddle_pos=None, pen_pos=None, **kwargs)[source]

Compass-and-straightedge animation: place the compass’s niddle_tip and pen_tip at the given positions.

Parameters:
  • compass (Compass) – The compass.

  • niddle_pos (Point) – Position for niddle_tip.

  • pen_pos (Point) – Position for pen_tip.

class manim_extensions.compass.PutCompassAway(compass, point=array([1., 0., 0.]), span_buff=0.1, **kwargs)[source]

Bases: PutCompass

Compass-and-straightedge animation: put the compass aside at point, with the two tips separated by span_buff.

Example: PutCompassAwayDocExample

from manim import *
from manim_extensions.compass import Compass, PutCompassAway

class PutCompassAwayDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(PutCompassAway(compass, 2 * RIGHT))
        self.wait()
from manim import *
from manim_extensions.compass import Compass, PutCompassAway

class PutCompassAwayDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        self.play(PutCompassAway(compass, 2 * RIGHT))
        self.wait()

__init__(compass, point=array([1., 0., 0.]), span_buff=0.1, **kwargs)[source]

Compass-and-straightedge animation: put the compass aside at point, with the two tips separated by span_buff.

Parameters:
  • compass (Compass) – The compass.

  • point (Point) – Position to place the compass.

  • span_buff (float) – Distance between the two tips when placed aside.

class manim_extensions.compass.DrawArc(compass, arc, **kwargs)[source]

Bases: AnimationGroup

Compass-and-straightedge animation: draw an arc.

Example: DrawArcDocExample

from manim import *
from manim_extensions.compass import Compass, DrawArc
from manim.mobject.geometry.arc import Arc

class DrawArcDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        arc = Arc(arc_center=ORIGIN, radius=1, angle=PI / 2)
        self.play(DrawArc(compass, arc))
        self.wait()
from manim import *
from manim_extensions.compass import Compass, DrawArc
from manim.mobject.geometry.arc import Arc

class DrawArcDocExample(Scene):
    def construct(self):
        compass = Compass().to_edge(LEFT)
        arc = Arc(arc_center=ORIGIN, radius=1, angle=PI / 2)
        self.play(DrawArc(compass, arc))
        self.wait()

__init__(compass, arc, **kwargs)[source]

Compass-and-straightedge animation: draw an arc. Note: before this animation, move the compass needle tip (niddle_tip) to the centre of the arc, and move the compass pen tip to the start of the arc.

Parameters:
  • compass (Compass) – The compass.

  • arc (Arc) – The arc to draw.