Python मा Manim: गणितीय एनिमेसन बनाउने शक्तिशाली लाइब्रेरी

August 5, 2026

Python मा Manim: गणितीय एनिमेसन बनाउने शक्तिशाली लाइब्रेरी

Manim (Mathematical Animation Engine) Python मा आधारित एक शक्तिशाली Open Source लाइब्रेरी हो, जसको प्रयोग गणित, विज्ञान, कम्प्युटर विज्ञान तथा इन्जिनियरिङसँग सम्बन्धित अवधारणाहरूलाई आकर्षक एनिमेसनमार्फत प्रस्तुत गर्न गरिन्छ।

यसलाई प्रसिद्ध गणितीय YouTube च्यानल 3Blue1Brown का संस्थापक Grant Sanderson ले विकास गरेका हुन्। आज Manim Community Edition विश्वभरका शिक्षक, विद्यार्थी, अनुसन्धानकर्ता तथा Content Creator हरूमाझ अत्यन्त लोकप्रिय बनेको छ।


Manim भनेको के हो?

Manim (Mathematical Animation Engine) एउटा Python Library हो जसले Program मार्फत Graphics तथा Animation तयार गर्छ। यसमा Shape, Graph, Coordinate System, Formula, Geometry, Calculus, Linear Algebra, Statistics, Physics लगायतका विषयहरूलाई Animated Video मा रूपान्तरण गर्न सकिन्छ।


Manim का प्रमुख विशेषताहरू

  • Open Source Library
  • Python Programming आधारित
  • Professional Quality Animation
  • Mathematical Formula (LaTeX) Support
  • 2D तथा 3D Animation
  • Coordinate Plane Support
  • Graph Plotting
  • Vector तथा Geometry Drawing
  • High Quality Video Rendering
  • Cross Platform (Windows, Linux, macOS)

Manim किन प्रयोग गर्ने?

Manim प्रयोग गर्नुका मुख्य कारणहरू:

  • गणितलाई दृश्यात्मक रूपमा बुझाउन
  • Online Learning सामग्री बनाउन
  • YouTube Educational Video तयार गर्न
  • Presentation लाई आकर्षक बनाउन
  • अनुसन्धान तथा Project Presentation मा प्रयोग गर्न
  • Interactive Educational Content विकास गर्न

Manim Installation

Python Install

सबैभन्दा पहिले Python Install भएको हुनुपर्छ।

python --version

pip Upgrade

python -m pip install --upgrade pip

Manim Install

pip install manim

Version Check

manim --version

Manim को आधारभूत संरचना

प्रत्येक Manim Program एउटा Scene Class बाट सुरु हुन्छ।

from manim import *

class Hello(Scene):
    def construct(self):
        pass

पहिलो Program

from manim import *

class Hello(Scene):
    def construct(self):
        text = Text("Hello Manim")
        self.play(Write(text))
        self.wait(2)

Run गर्ने:

manim -pqh hello.py Hello

Scene भनेको के हो?

Scene भनेको एउटा सम्पूर्ण Animation हो।

उदाहरण:

class Example(Scene):
    def construct(self):
        pass

Mobject भनेको के हो?

Manim मा देखिने प्रत्येक Object लाई Mobject (Mathematical Object) भनिन्छ।

उदाहरण:

  • Text
  • Circle
  • Square
  • Line
  • Dot
  • Polygon
  • Rectangle
  • Triangle
  • Graph

Text लेख्ने

text = Text("Python")

Mathematical Formula

formula = MathTex(r"E=mc^2")

Circle

circle = Circle()

Square

square = Square()

Rectangle

rect = Rectangle()

Triangle

triangle = Triangle()

Dot

dot = Dot()

Line

line = Line(LEFT, RIGHT)

Arrow

arrow = Arrow(LEFT, RIGHT)

Coordinate Plane

plane = NumberPlane()

Axes

axes = Axes()

Graph Plot गर्ने

axes = Axes(
    x_range=[-5,5],
    y_range=[-2,10]
)

graph = axes.plot(lambda x: x**2)

रंग (Colors)

Manim मा प्रयोग हुने केही मुख्य Color:

  • RED
  • BLUE
  • GREEN
  • YELLOW
  • ORANGE
  • WHITE
  • BLACK
  • PURPLE
  • PINK
  • GOLD
  • GREY
  • MAROON
  • TEAL

उदाहरण:

Circle(color=RED)

Object लाई Move गर्ने

circle.shift(RIGHT)

Scale गर्ने

circle.scale(2)

Rotate गर्ने

circle.rotate(PI/4)

Fill Color

circle.set_fill(BLUE, opacity=0.7)

Stroke Color

circle.set_stroke(RED, width=4)

Animation Commands

Create

self.play(Create(circle))

Write

self.play(Write(text))

FadeIn

self.play(FadeIn(circle))

FadeOut

self.play(FadeOut(circle))

Transform

self.play(Transform(circle, square))

ReplacementTransform

self.play(
    ReplacementTransform(circle, square)
)

Rotate

self.play(
    Rotate(square, PI)
)

Move

self.play(
    square.animate.shift(RIGHT)
)

Wait

self.wait(2)

Position Functions

  • UP
  • DOWN
  • LEFT
  • RIGHT
  • ORIGIN

उदाहरण:

circle.to_edge(LEFT)
text.next_to(circle, RIGHT)

Group

group = VGroup(circle, square)

ValueTracker

Animation मा Value परिवर्तन गर्न प्रयोग गरिन्छ।

tracker = ValueTracker(0)

always_redraw()

Dynamic Object बनाउन प्रयोग गरिन्छ।

dot = always_redraw(
    lambda: Dot(
        [tracker.get_value(),0,0]
    )
)

TracedPath

Object को Movement Trace गर्न प्रयोग हुन्छ।

trace = TracedPath(dot.get_center)

उपयोगका क्षेत्र

Manim निम्न क्षेत्रमा अत्यन्त उपयोगी छ।

  • Mathematics
  • Physics
  • Statistics
  • Computer Science
  • Machine Learning
  • Artificial Intelligence
  • Data Structures
  • Algorithms
  • Geometry
  • Calculus
  • Linear Algebra
  • Signal Processing

Manim का फाइदाहरू

  • Professional Animation
  • High Quality Output
  • Python आधारित
  • Open Source
  • Reusable Code
  • YouTube Ready Video
  • Mathematical Formula Support
  • 2D तथा 3D Animation
  • Excellent Documentation
  • ठूलो Community Support

सीमितताहरू

  • सिक्न केही समय लाग्छ।
  • Rendering प्रक्रिया कहिलेकाहीँ ढिलो हुन सक्छ।
  • FFmpeg, Cairo आदि अतिरिक्त Dependency आवश्यक पर्न सक्छ।
  • शुरुआती प्रयोगकर्ताका लागि Error समाधान गर्न चुनौतीपूर्ण हुन सक्छ।
  • राम्रो Performance का लागि सक्षम कम्प्युटर उपयोगी हुन्छ।

← Back to Blogs