Dot¶
- class Dot(center: Point, plane: PolarPlane, **kwargs)[source]¶
Represent a dot in the hyperbolic plane that is addressed using polar coordinates.
- Parameters:
point – The
hmanim.native.point.Point
at which the dot is placed.plane – The
PolarPlane
in which theDot
lives.
Examples
Example: DotExample ¶
from manim import * from hmanim.native import Dot, Point class DotExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) dot = Dot(Point(0, 0), plane=plane) self.add(dot)
from hmanim.native import Dot, Point class DotExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) dot = Dot(Point(0, 0), plane=plane) self.add(dot)
- property center: Point¶
The
hmanim.native.point.Point
at which theDot
is placed.
- move_to(point: ndarray[tuple[int, ...], dtype[float64]]) Dot [source]¶
Move the
Dot
to a newPoint2D
. Note that this method gets a point on in Cartesian coordinates and not polar ones.
- set_center(point: Point) Dot [source]¶
Change the
hmanim.native.point.Point
at which the class:Dot is placed.- Parameters:
point (hmanim.native.point.Point) – The new
Point
at which theDot
is placed.- Returns:
The
Dot
that was moved.- Return type:
- class DotRotate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Rotates the
Dot
around the origin by a given angle.Examples
Example: DotRotateExample ¶
from manim import * from hmanim.native import Dot, DotRotate, Point class DotRotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the dot. dot = Dot(Point(5.0, 0.0), plane) self.add(dot) # Rotate the dot by TAU / 4 radians. self.play(DotRotate(dot, TAU / 4))
from hmanim.native import Dot, DotRotate, Point class DotRotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the dot. dot = Dot(Point(5.0, 0.0), plane) self.add(dot) # Rotate the dot by TAU / 4 radians. self.play(DotRotate(dot, TAU / 4))
- interpolate_mobject(alpha: float)[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 DotRotatedTranslate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Similar to
DotTranslate
but instead of translating along the x-axis, we translate along an axis that is rotated away from the x-axis by a given angle.Examples
Example: DotRotatedTranslateExample ¶
from manim import * from hmanim.native import Dot, DotRotatedTranslate, Point class DotRotatedTranslateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the dot. dot = Dot( center=Point(0.0, 0.0), plane=plane, ) self.add(dot) # Translate the dot. self.play( DotRotatedTranslate( dot, distance=3, angle=TAU / 8 ) )
from hmanim.native import Dot, DotRotatedTranslate, Point class DotRotatedTranslateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the dot. dot = Dot( center=Point(0.0, 0.0), plane=plane, ) self.add(dot) # Translate the dot. self.play( DotRotatedTranslate( dot, distance=3, angle=TAU / 8 ) )
- interpolate_mobject(alpha: float)[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 DotSetRadialCoordinate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Sets the radial coordinate of the
Dot
to a given value.Examples
Example: DotSetRadialCoordinateExample ¶
from manim import * from hmanim.native import Dot, DotSetRadialCoordinate, Point class DotSetRadialCoordinateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) self.add(plane) # Draw the dot. dot = Dot(Point(1.0, TAU / 8), plane) self.add(dot) # Translate and rotate the dot. self.play( DotSetRadialCoordinate( dot, radius=4.0 ) )
from hmanim.native import Dot, DotSetRadialCoordinate, Point class DotSetRadialCoordinateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) self.add(plane) # Draw the dot. dot = Dot(Point(1.0, TAU / 8), plane) self.add(dot) # Translate and rotate the dot. self.play( DotSetRadialCoordinate( dot, radius=4.0 ) )
- interpolate_mobject(alpha: float)[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 DotTranslate(mobject=None, *args, use_override=True, **kwargs)[source]¶
This translation represents a movement of a point from the origin along the x-axis by a specified distance. All other points in the plane, in particular the
Dot
, are moved in such a way, that the distance to the moving point remain unchanged.Examples
Example: DotTranslateExample ¶
from manim import * from hmanim.native import Dot, DotTranslate, Point class DotTranslateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the dot. dot = Dot(Point(), plane=plane) self.add(dot) # Translate the dot horizontally by 5. self.play(DotTranslate(dot, 5.0))
from hmanim.native import Dot, DotTranslate, Point class DotTranslateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the dot. dot = Dot(Point(), plane=plane) self.add(dot) # Translate the dot horizontally by 5. self.play(DotTranslate(dot, 5.0))
- interpolate_mobject(alpha: float)[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 DotTranslateAndRotate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Translate the
Dot
by a given distance and rotate the axis along which it is being translated by at the same time.Examples
Example: DotTranslateAndRotateExample ¶
from manim import * from hmanim.native import Dot, DotTranslateAndRotate, Point class DotTranslateAndRotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) self.add(plane) # Draw the dot. dot = Dot(Point(0.0, 0.0), plane) self.add(dot) # Translate and rotate the dot. self.play( DotTranslateAndRotate( dot, distance=4, angle=TAU / 4 ) )
from hmanim.native import Dot, DotTranslateAndRotate, Point class DotTranslateAndRotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) self.add(plane) # Draw the dot. dot = Dot(Point(0.0, 0.0), plane) self.add(dot) # Translate and rotate the dot. self.play( DotTranslateAndRotate( dot, distance=4, angle=TAU / 4 ) )
- interpolate_mobject(alpha: float)[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.