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


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 224

Software

Application 213

Digitization 32

Latex 52

Manim 204

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 33

Coordinate Geometry 2

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-2022 Sideway . All rights reserved Disclaimers last modified on 06 September 2019