Geometric objects

Arc types

Arc

class manimlib.mobject.geometry.Arc(angle, **kwargs)

Type: VMobject

Parameters

angle (float) -- Angle of arc

CONFIG parameters

"radius": 1.0,
"start_angle": 0,
"arc_center": ORIGIN,
add_tip(tip_length=0.25, at_start=False, at_end=True)

Add tip

get_arc_center()

Get arc center

Returns

Arc center

Return type

3D array

move_arc_center_to(point)

Move arc center to point

ArcBetweenPoints

class manimlib.mobject.geometry.ArcBetweenPoints(start_point, end_point, angle=1.5707963267948966, **kwargs)

Type: Arc

Parameters
  • start_point,end_point (3D array) -- Points

  • angle (float) -- TAU/4 by default

CONFIG parameters: The same as Arc

CurvedArrow

class manimlib.mobject.geometry.CurvedArrow(start_point, end_point, angle=1.5707963267948966, **kwargs)

Type: ArcBetweenPoints

CONFIG parameters: The same as ArcBetweenPoints

CurvedDoubleArrow

class manimlib.mobject.geometry.CurvedDoubleArrow(start_point, end_point, angle=1.5707963267948966, **kwargs)

Type: ArcBetweenPoints

CONFIG parameters: The same as ArcBetweenPoints

Circle

class manimlib.mobject.geometry.Circle(**kwargs)

Type: Arc

CONFIG parameters

"color": RED
get_point_from_angle(angle)

Get point from angle

Returns

Point of angle

Return type

3D array

Dot

class manimlib.mobject.geometry.Dot(point=array([0.0, 0.0, 0.0]), **kwargs)

Type: Circle

Parameters

point (3D array) -- Position

CONFIG parameters

"radius": 0.08,
"stroke_width": 0,
"fill_opacity": 1.0,
"color": WHITE

Ellipse

class manimlib.mobject.geometry.Ellipse(*submobjects, **kwargs)

Type: VMobject

CONFIG parameters

"width": 2,
"height": 1

AnnularSector

class manimlib.mobject.geometry.AnnularSector(*submobjects, **kwargs)

Type: VMobject

CONFIG parameters

"inner_radius": 1,
"outer_radius": 2,
"angle": TAU / 4,
"start_angle": 0,
"fill_opacity": 1,
"stroke_width": 0,
"color": WHITE,
get_arc_center()

Get arc center

move_arc_center_to(point)

Move arc center to point

Sector

class manimlib.mobject.geometry.Sector(*submobjects, **kwargs)

Type: AnnularSector

CONFIG parameters

"outer_radius": 1,
"inner_radius": 0

Annulus

class manimlib.mobject.geometry.Annulus(**kwargs)

Type: Circle

CONFIG parameters

"inner_radius": 1,
"outer_radius": 2,
"fill_opacity": 1,
"stroke_width": 0,
"color": WHITE,

Line types

Line

class manimlib.mobject.geometry.Line(start, end, **kwargs)

Type: VMobject

Parameters

start,end (3D array) -- Points of the line

CONFIG parameters

"buff": 0,
"path_arc": None,  # angle of arc specified here
"n_arc_anchors": 10,  # Only used if path_arc is not None
get_angle()

Get angle taking the horizontal as a reference

Returns

Angle

Return type

Float

get_arc_length()

Get arc length

Returns

Arc length

Return type

float

Note

Only works if path_arc is not None

get_end()

Get end

Returns

Point

Return type

3D array

get_length()

Get length

Returns

Lenght of the line

Return type

float

get_start()

Get start

Returns

Point

Return type

3D array

get_start_and_end()

Get start and end of the line

Returns

  • Start of the line (3D array)

  • End of the line (3D array)

get_unit_vector()

Get unit vector of the line

Returns

Unit vector

Return type

3D array

get_vector()

Get vector with the length of the line

Returns

Vector

Return type

3D array

put_start_and_end_on(new_start, new_end)

Put start and end on new points

set_angle(angle)

Set angle taking the horizontal as a reference

set_start_and_end(start, end)

Set start and end

DashedLine

class manimlib.mobject.geometry.DashedLine(*args, **kwargs)

Type: Line

CONFIG parameters

"dashed_segment_length": 0.05
get_end()

Get end

Returns

Point

Return type

3D array

get_start()

Get start

Returns

Point

Return type

3D array

Elbow

class manimlib.mobject.geometry.Elbow(**kwargs)

Type: VMobject

CONFIG parameters

"width": 0.2,
"angle": 0,

Arrow

class manimlib.mobject.geometry.Arrow(*args, **kwargs)

Type: Line

CONFIG parameters

"tip_length": 0.25,
"tip_width_to_length_ratio": 1,
"max_tip_length_to_length_ratio": 0.35,
"max_stem_width_to_tip_width_ratio": 0.3,
"buff": MED_SMALL_BUFF,
"propagate_style_to_family": False,
"preserve_tip_size_when_scaling": True,
"normal_vector": OUT,
"use_rectangular_stem": True,
"rectangular_stem_width": 0.05,
get_end()

Get end

Returns

Point

Return type

3D array

get_normal_vector()

Get normal vector

Returns

Normal vector

Return type

3D array

get_tip()

Get tip

Returns

Tip

Return type

VMobject

put_start_and_end_on(*args, **kwargs)

Put start and end in new points

scale(scale_factor, **kwargs)

Scale without change tip size

DoubleArrow

class manimlib.mobject.geometry.DoubleArrow(*args, **kwargs)

Type: Arrow

Vector

class manimlib.mobject.geometry.Vector(direction, **kwargs)

Type: Arrow

Parameters

direction (3D array) -- Vector is: Arrow(ORIGIN,direction)

CONFIG parameters

"color": YELLOW,
"buff": 0,

CubicBezier

class manimlib.mobject.geometry.CubicBezier(points, **kwargs)

Type: VMobject

Parameters

points (list of arrays) -- Bezier using list of arrays

Rectangle types

Polygon

class manimlib.mobject.geometry.Polygon(*vertices, **kwargs)

Type: VMobject

Parameters

*vertices (list of 3D arrays) -- Vertices of the poligon as list

CONFIG parameters

"color": GREEN_D,
"mark_paths_closed": True,
"close_new_points": True,
get_vertices()

Get vertices

Returns

List of points

Return type

List of 3D arrays

RegularPolygon

class manimlib.mobject.geometry.RegularPolygon(n=3, **kwargs)

Type: Polygon

Parameters

n (int) -- Number of sides

CONFIG parameters

"start_angle": 0

Rectangle

class manimlib.mobject.geometry.Rectangle(*submobjects, **kwargs)

Type: VMobject

CONFIG parameters

"color": WHITE,
"height": 2.0,
"width": 4.0,
"mark_paths_closed": True,
"close_new_points": True,

RoundedRectangle

class manimlib.mobject.geometry.RoundedRectangle(*submobjects, **kwargs)

Type: Rectangle

CONFIG parameters

"corner_radius": 0.5,
"close_new_points": True

Grid

class manimlib.mobject.geometry.Grid(rows, columns, **kwargs)

Type: VMobject

Parameters

rows,columns (int) -- Grid of ROWS x COLUMNS

CONFIG parameters

"height": 6.0,
"width": 6.0,