Arc¶
- class Arc(center: Point, radius: float, start_angle: float, angle: float, plane: PolarPlane, is_closed: bool = False, **kwargs)[source]¶
A circular arc.
- Parameters:
center – A
hmanim.poincare.point.Point
representing the center of the circle that theArc
lives on.radius – A float representing the radius of the circle that the
Arc
lives on.start_angle – A float representing the angle at which the arc starts.
angle – A float representing the angular width of the arc, i.e., how far it extends from the start_angle.
plane – The
PolarPlane
in which theArc
lives.
Examples
Example: ArcExample ¶
from manim import * from hmanim.native import Arc, Point class ArcExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the arc. arc = Arc( center=Point(), radius=5.0, start_angle=0.0, angle=TAU / 8, plane=plane ) self.add(arc)
from hmanim.native import Arc, Point class ArcExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the arc. arc = Arc( center=Point(), radius=5.0, start_angle=0.0, angle=TAU / 8, plane=plane ) self.add(arc)
- property center: Point¶
Moves the center of the mobject to the center of the scene.
- Returns:
The centered mobject.
- Return type:
Mobject
- copy() Arc [source]¶
Create and return an identical copy of the
Mobject
including allsubmobjects
.- Returns:
The copy.
- Return type:
Mobject
Note
The clone is initially not visible in the Scene, even if the original was.
- static get_render_angles(center: Point, start_angle: float, angle: float) list[float] [source]¶
Determines the angle of the points on the path that represents the boundary of the
Arc
.
- rotated_by(angle: float) Arc [source]¶
Rotate the
Arc
by the given angle. Note that theArc
is rotated around the origin of its plane.
- set_center(center: Point) Arc [source]¶
Move the center of the
Arc
to the given center.- Parameters:
center (hmanim.native.point.Point) – The new center of the
Arc
.- Returns:
The
Arc
with the new center.- Return type:
- set_center_of_projection(point: Point) Arc [source]¶
Change the center of projection of the
Arc
.- Parameters:
point (hmanim.native.point.Point) – The new center of projection of the
Arc
.- Returns:
The
Arc
with the new center of projection.- Return type:
- class ArcScale(mobject=None, *args, use_override=True, **kwargs)[source]¶
Scale the radius of an
Arc
by a given factor.Examples
Example: ArcScaleExample ¶
from manim import * from hmanim.native import Arc, ArcScale, Point class ArcScaleExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the arc. arc = Arc( center=Point(0.0, 0.0), radius=5.0, start_angle=0.0, angle=TAU / 8, plane=plane, ) self.add(arc) # Scale the arc radius by a factor of 1.5. self.play(ArcScale(arc, 1.5))
from hmanim.native import Arc, ArcScale, Point class ArcScaleExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the arc. arc = Arc( center=Point(0.0, 0.0), radius=5.0, start_angle=0.0, angle=TAU / 8, plane=plane, ) self.add(arc) # Scale the arc radius by a factor of 1.5. self.play(ArcScale(arc, 1.5))
- interpolate_mobject(alpha: float) None [source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.
- class ArcStretchAngle(mobject=None, *args, use_override=True, **kwargs)[source]¶
Stretch the angle of an
Arc
to a new value.Examples
Example: ArcStretchAngleExample ¶
from manim import * from hmanim.native import Arc, ArcStretchAngle, Point class ArcStretchAngleExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the arc. arc = Arc( center=Point(0.0, 0.0), radius=5.0, start_angle=0.0, angle=TAU / 8, plane=plane, ) self.add(arc) # Stretch the angle of the arc. self.play(ArcStretchAngle(arc, TAU / 4))
from hmanim.native import Arc, ArcStretchAngle, Point class ArcStretchAngleExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the arc. arc = Arc( center=Point(0.0, 0.0), radius=5.0, start_angle=0.0, angle=TAU / 8, plane=plane, ) self.add(arc) # Stretch the angle of the arc. self.play(ArcStretchAngle(arc, TAU / 4))
- interpolate_mobject(alpha: float) None [source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.
- class ArcStretchAngleInverse(mobject=None, *args, use_override=True, **kwargs)[source]¶
Like
ArcStretchAngle
but stretches in the inverse direction.Examples
Example: ArcStretchAngleInverseExample ¶
from manim import * from hmanim.native import Arc, ArcStretchAngleInverse, Point class ArcStretchAngleInverseExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the arc. arc = Arc( center=Point(0.0, 0.0), radius=5.0, start_angle=0.0, angle=TAU / 8, plane=plane, ) self.add(arc) # Stretch the angle of the arc. self.play(ArcStretchAngleInverse(arc, TAU / 4))
from hmanim.native import Arc, ArcStretchAngleInverse, Point class ArcStretchAngleInverseExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the arc. arc = Arc( center=Point(0.0, 0.0), radius=5.0, start_angle=0.0, angle=TAU / 8, plane=plane, ) self.add(arc) # Stretch the angle of the arc. self.play(ArcStretchAngleInverse(arc, TAU / 4))
- interpolate_mobject(alpha: float) None [source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.