Sideway
output.to from Sideway
Draft for Information Only

Content

Manim Number Line
 Codes in Number_line.py
  Import
  Class NumberLine(Line)
   Configuration
   Functions
  Class UnitInterval(NumberLine)
   Configuration
 Source and Reference

Manim Number Line

The numeric line VMobject object in Manim is defined in number_line.py.

Codes in Number_line.py

Available codes defined in manimlib.mobject.number_line.py

image

Two classes, NumberLine, and UnitInterval are defined.

Import

import operator as op

from manimlib.constants import *
from manimlib.mobject.geometry import Line
from manimlib.mobject.numbers import DecimalNumber
from manimlib.mobject.types.vectorized_mobject import VGroup
from manimlib.utils.bezier import interpolate
from manimlib.utils.config_ops import digest_config
from manimlib.utils.config_ops import merge_dicts_recursively
from manimlib.utils.simple_functions import fdiv
from manimlib.utils.space_ops import normalize

Class NumberLine(Line)

class manimlib.mobject.number_line.NumberLine(Line)version 19Dec2019

Configuration

    CONFIG = {
        "color": LIGHT_GREY,
        "x_min": -FRAME_X_RADIUS,
        "x_max": FRAME_X_RADIUS,
        "unit_size": 1,
        "include_ticks": True,
        "tick_size": 0.1,
        "tick_frequency": 1,
        # Defaults to value near x_min s.t. 0 is a tick
        # TODO, rename this
        "leftmost_tick": None,
        # Change name
        "numbers_with_elongated_ticks": [0],
        "include_numbers": False,
        "numbers_to_show": None,
        "longer_tick_multiple": 2,
        "number_at_center": 0,
        "number_scale_val": 0.75,
        "label_direction": DOWN,
        "line_to_number_buff": MED_SMALL_BUFF,
        "include_tip": False,
        "tip_width": 0.25,
        "tip_height": 0.25,
        "decimal_number_config": {
            "num_decimal_places": 0,
        },
        "exclude_zero_from_default_numbers": False,
    }

Functions

  • def __init__(self, **kwargs)
  • def init_leftmost_tick(self)
  • def add_tick_marks(self)
  • def get_tick(self, x, size=None)
  • def get_tick_marks(self)
  • def get_tick_numbers(self)
  • def number_to_point(self, number)
  • def point_to_number(self, point)
    • def distance_from_start(p)
  • def n2p(self, number)
  • def p2n(self, point)
  • def get_unit_size(self)
  • def default_numbers_to_display(self)
  • def get_number_mobject(self, number, number_config=None, scale_val=None, direction=None, buff=None)
  • def get_number_mobjects(self, *numbers, **kwargs)
  • def get_labels(self)
  • def add_numbers(self, *numbers, **kwargs)

Class UnitInterval(NumberLine)

class manimlib.mobject.number_line.UnitInterval(NumberLine)version 19Dec2019

Configuration

    CONFIG = {
        "x_min": 0,
        "x_max": 1,
        "unit_size": 6,
        "tick_frequency": 0.1,
        "numbers_with_elongated_ticks": [0, 1],
        "number_at_center": 0.5,
        "decimal_number_config": {
            "num_decimal_places": 1,
        }
    }

Source and Reference

https://github.com/3b1b/manim19Dec2019

©sideway

ID: 210700020 Last Updated: 7/20/2021 Revision: 0

IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 337

Reference 68

Computer

Hardware 154

Software

Application 207

Digitization 25

Latex 35

Manim 203

Numeric 19

Programming

Web 285

Unicode 504

HTML 65

CSS 63

SVG 6

ASP.NET 210

OS 422

DeskTop 7

Python 64

Knowledge

Mathematics

Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 25

Coordinate Geometry 1

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2021 Sideway . All rights reserved Disclaimers last modified on 06 September 2019