Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

document some of the constants that are exposed to the end user

leotrsb27fd1ffae05
diff --git a/manim/constants.py b/manim/constants.py
index 81674b220..074277c47 100644
--- a/manim/constants.py
+++ b/manim/constants.py
@@ -1,5 +1,10 @@
+"""
+Constant definitions.
+"""
+
import numpy as np
+
# Messages
NOT_SETTING_FONT_MSG = """
You haven't set font.
@@ -32,12 +37,19 @@ BOLD = "BOLD"
# Geometry: directions
ORIGIN = np.array((0.0, 0.0, 0.0))
+"""The center of the coordinate system."""
UP = np.array((0.0, 1.0, 0.0))
+"""One unit step in the positive Y direction."""
DOWN = np.array((0.0, -1.0, 0.0))
+"""One unit step in the negative Y direction."""
RIGHT = np.array((1.0, 0.0, 0.0))
+"""One unit step in the positive X direction."""
LEFT = np.array((-1.0, 0.0, 0.0))
+"""One unit step in the nevative X direction."""
IN = np.array((0.0, 0.0, -1.0))
+"""One unit step in the nevative Z direction."""
OUT = np.array((0.0, 0.0, 1.0))
+"""One unit step in the positive Z direction."""
# Geometry: axes
X_AXIS = np.array((1.0, 0.0, 0.0))
@@ -46,9 +58,13 @@ Z_AXIS = np.array((0.0, 0.0, 1.0))
# Geometry: useful abbreviations for diagonals
UL = UP + LEFT
+"""One step up plus one step left."""
UR = UP + RIGHT
+"""One step up plus one step right."""
DL = DOWN + LEFT
+"""One step down plus one step left."""
DR = DOWN + RIGHT
+"""One step down plus one step right."""
# Geometry
START_X = 30
@@ -73,8 +89,11 @@ DEFAULT_STROKE_WIDTH = 4
# Mathematical constants
PI = np.pi
+"""The ratio of the circumference of a circle to its diameter."""
TAU = 2 * PI
+"""The ratio of the circumference of a circle to its radius."""
DEGREES = TAU / 360
+"""The exchange rate between radians and degrees."""
# ffmpeg stuff
FFMPEG_BIN = "ffmpeg"