Skip to content

Right-Angled Triangle

Right-Angled Triangle Parameters#

Parameters - as mentioned in Azarzadvillas Documentation - are:

  • Constructor : - Polygon

  • RIGHT+UP

  • RIGHT+DOWN
  • LEFT+DOWN
  • LEFT+UP

Note: Use only 3 of the previous parameters. And manipulate/interchange between them to change orientation of the right angle triangle

Triangle Creation#

from manimlib import *

class RightTriangle(Scene):
    def construct(self):
        triangle = Polygon(RIGHT+UP, RIGHT+DOWN, LEFT+DOWN)
        triangle.set_stroke(YELLOW)
        self.wait()
        self.play(ShowCreation(triangle), run_time=3)
        triangle.set_fill(GREEN, opacity=1)
        self.wait()
from manim import *
import numpy as np

class RightTriangle(Scene):
    def construct(self):
        triangle = Polygon(RIGHT+UP, RIGHT+DOWN, LEFT+DOWN)
        triangle.set_stroke(YELLOW)
        self.wait()
        self.play(Create(triangle), run_time=3)
        triangle.set_fill(GREEN, opacity=1)
        self.wait()
Back to top