from manimlib.imports import *
import numpy as np

class Silinder(ThreeDScene,Scene):
    def construct(self):
        judulkali = TextMobject("Cylindrical Coordinates")
        judulkali.scale(1.25)
        judulkali.set_color_by_gradient(PURPLE,RED)
        self.play(Write(judulkali))
        self.wait(2)
        self.set_camera_orientation(phi=75 * DEGREES)
        self.begin_ambient_camera_rotation(rate=0.2)
        axes = ThreeDAxes()
        self.play(ReplacementTransform(judulkali,axes),run_time=1.5)
        dot3 = Dot(np.array([4,3,0]), radius=0.08, color=YELLOW)
        gariss= DashedLine([3, 0, 0], color=RED)
        a = (4,3,0)
        b = (4,3,3)
        gariss3= DashedLine(a,b)
        gariss3.set_color_by_gradient(GREEN,YELLOW)
        c = (4,3,3)
        d = (0,0,3)
        dot4 = Dot(np.array([4,3,3]), radius=0.08, color=YELLOW)
        
        gariss4=DashedLine(c,d)
        gariss.shift(3*UP)
        gariss.scale(2)
        START = (4,0,0)
        END =   (4,1.5,0)
        angle = math.radians(35)
        arc =  Arc(radius=2,angle=angle)
        gariss1= DashedLine(START,END)
        gariss1.scale(2)
        gariss1.shift(0.75*UP)
        gariss2= Arrow([0, 0, 0], [4, 3, 0], color=BLUE)
        gariss2.scale(1.1)
        self.play(FadeIn(dot3))
        self.play(Write(gariss1))
        self.play(Write(gariss))
        self.play(Write(gariss2))
        self.wait()
        mmm = (0,0,2)
        
        self.play(Write(gariss3))
        self.play(Write(gariss4))
        self.play(Write(arc))
        self.play(Write(dot4))
        aaa = (VGroup(arc,dot4,dot3,gariss3,gariss4,gariss2,gariss,gariss1,axes))
        
        self.wait(2)
     
        garissteh = (VGroup(gariss3,gariss4,gariss1,gariss2,gariss,dot3,dot4))
        self.wait(3)
        self.play(ApplyMethod(aaa.scale,0.4))
        self.play(ApplyMethod(aaa.move_to,mmm))
        
        self.wait()
#TEKS
        judulkali = TextMobject("Cylindrical Coordinates")
        judulkali.scale(1.25)
        judulkali.set_color_by_gradient(PURPLE,RED)
        self.add_fixed_in_frame_mobjects(judulkali)
        self.play(Write(judulkali))
        self.wait(2)
        self.play(ApplyMethod(judulkali.move_to,3.5*UP))
        warna = TextMobject("Misal garis yang berwarna merah adalah x1, Garis biru adalah ","$\\bar{x1}$","dan garis KUNING adalah x3")
        namaa = TextMobject("P :(X1, X2, X3) pada setiap garis adalah rectangular coordinat")
        namaaa = TextMobject("$\\vec{\\vec{\\tau }}$ adalah sebuah transformasi koordinat curvaliniear",color=YELLOW)
        namaa1 = TextMobject("$\\vec{x}^1 = \sqrt{(x^1 + x^2)}^2$")
        namaa2 = TextMobject("$\\vec{x}^1 = arctan (x^2/x^1)$")
        namaa3 = TextMobject("$\\vec{x}^1 = x^3$")
        namaa4 = TextMobject("$x^1 = \\vec{x} cos (\\vec{x^2})$")
        namaa5 = TextMobject("$x^2 = \\vec{x} sin (\\vec{x^2})$")
        namaa6 = TextMobject("$x^3 = \\vec{x^3}$")
        namaa.set_color_by_gradient(RED,GREEN)
        warna.scale(0.8)
        warna.set_color_by_gradient(RED,BLUE)
        warna.shift(3*DOWN)
        apatehkotakk2 = Rectangle(height = 1.3, width = 13.5)
        apatehkotakk2.set_fill(YELLOW, opacity= 1)
        apatehkotakk2.shift(3*DOWN)
        self.add_fixed_in_frame_mobjects(apatehkotakk2)
        self.remove(apatehkotakk2)
        self.play(Write(apatehkotakk2))
        self.add_fixed_in_frame_mobjects(warna)
        self.remove(warna)
        self.play(Write(warna))
        self.wait(3)
        self.add_fixed_in_frame_mobjects(namaa)
        self.remove(namaa)
        self.play(Write(namaa))
        namaa.set_color_by_gradient(RED,BLUE)
        namaa.set_color_by_gradient(RED,BLUE)
        self.wait(2)
        self.add_fixed_in_frame_mobjects(namaa)
        self.remove(namaa)
        self.add_fixed_in_frame_mobjects(namaaa)
        self.remove(namaaa)
        self.play(ReplacementTransform(namaa,namaaa),run_time=1.5)
        self.wait(2)

        namaa1.shift(1.5*UP)
        namaa2.next_to(namaa1,DOWN)
        namaa3.next_to(namaa2,DOWN)
        namaa4.shift(1.5*UP)
        namaa5.next_to(namaa4,DOWN)
        namaa6.next_to(namaa5,DOWN)
        namaateh = (VGroup(namaa1,namaa2,namaa3))
        namaateh1 = (VGroup(namaa4,namaa5,namaa6))
        namaateh.scale(1.1)
        namaateh.shift(1.5*DOWN)
        namaateh1.set_color_by_gradient(RED,BLUE)
        namaateh1.shift(1.5*DOWN)
        b_3 = Brace(namaateh, DOWN)
        b_4 = Brace(namaateh1, DOWN)
 
        tensor = TextMobject("Tc",color=(YELLOW))
        tensor1 = TextMobject("$Tc^{-1}$",color = (YELLOW))
#        namaaatt.shift(4*RIGHT)

        
             
        namaateh.set_color_by_gradient(YELLOW,PURPLE)
        namaateh1.scale(1.1)
        namaateh.set_color_by_gradient(RED,GREEN)
        self.add_fixed_in_frame_mobjects(namaaa)
        self.remove(namaaa)
        self.add_fixed_in_frame_mobjects(namaateh)
        self.remove(namaateh)
        self.play(Write(namaateh))
        self.wait()
        self.play(ApplyMethod(namaateh.move_to,2*UP+4.5*LEFT))
        self.add_fixed_in_frame_mobjects(b_3)
        self.remove(b_3)
        b_3.shift(2.75*UP+4.5*LEFT)
        self.play(Write(b_3), run_time=1.5)
        tensor.shift(0.1*DOWN+4.35*LEFT)
        tensor1.shift(0.1*DOWN+5.25*RIGHT)
               
        self.add_fixed_in_frame_mobjects(namaateh1)
        self.remove(namaateh1)
        
        self.play(Write(namaateh1))
        self.play(ApplyMethod(namaateh1.move_to,2*UP+5*RIGHT))
        
        self.add_fixed_in_frame_mobjects(tensor)
        self.remove(tensor)
        self.play(Write(tensor))
        self.wait(2)
        self.add_fixed_in_frame_mobjects(b_4)
        self.remove(b_4)
        b_4.shift(2.7*UP+5.05*RIGHT)
        self.play(Write(b_4))
        self.wait()
        self.add_fixed_in_frame_mobjects(tensor1)
        self.remove(tensor1)
        self.remove(tensor1)
        self.play(Write(tensor1))
        self.wait(3)
from manimlib.imports import *
import numpy as np

class Silinder(ThreeDScene,Scene):
    def construct(self):
        judulkali = TextMobject("Cylindrical Coordinates")
        judulkali.scale(1.25)
        judulkali.set_color_by_gradient(PURPLE,RED)
        self.play(Write(judulkali))
        self.wait(2)
        self.set_camera_orientation(phi=75 * DEGREES)
        self.begin_ambient_camera_rotation(rate=0.2)
        axes = ThreeDAxes()
        self.play(ReplacementTransform(judulkali,axes),run_time=1.5)
        dot3 = Dot(np.array([4,3,0]), radius=0.08, color=YELLOW)
        gariss= DashedLine([3, 0, 0], color=RED)
        a = (4,3,0)
        b = (4,3,3)
        gariss3= DashedLine(a,b)
        gariss3.set_color_by_gradient(GREEN,YELLOW)
        c = (4,3,3)
        d = (0,0,3)
        dot4 = Dot(np.array([4,3,3]), radius=0.08, color=YELLOW)
        
        gariss4=DashedLine(c,d)
        gariss.shift(3*UP)
        gariss.scale(2)
        START = (4,0,0)
        END =   (4,1.5,0)
        angle = math.radians(35)
        arc =  Arc(radius=2,angle=angle)
        gariss1= DashedLine(START,END)
        gariss1.scale(2)
        gariss1.shift(0.75*UP)
        gariss2= Arrow([0, 0, 0], [4, 3, 0], color=BLUE)
        gariss2.scale(1.1)
        self.play(FadeIn(dot3))
        self.play(Write(gariss1))
        self.play(Write(gariss))
        self.play(Write(gariss2))
        self.wait()
        mmm = (0,0,2)
        
        self.play(Write(gariss3))
        self.play(Write(gariss4))
        self.play(Write(arc))
        self.play(Write(dot4))
        aaa = (VGroup(arc,dot4,dot3,gariss3,gariss4,gariss2,gariss,gariss1,axes))
        
        self.wait(2)
     
        garissteh = (VGroup(gariss3,gariss4,gariss1,gariss2,gariss,dot3,dot4))
        self.wait(3)
        self.play(ApplyMethod(aaa.scale,0.4))
        self.play(ApplyMethod(aaa.move_to,mmm))
        
        self.wait()
#TEKS
        judulkali = TextMobject("Cylindrical Coordinates")
        judulkali.scale(1.25)
        judulkali.set_color_by_gradient(PURPLE,RED)
        self.add_fixed_in_frame_mobjects(judulkali)
        self.play(Write(judulkali))
        self.wait(2)
        self.play(ApplyMethod(judulkali.move_to,3.5*UP))
        warna = TextMobject("Misal garis yang berwarna merah adalah x1, Garis biru adalah ","$\\bar{x1}$","dan garis KUNING adalah x3")
        namaa = TextMobject("P :(X1, X2, X3) pada setiap garis adalah rectangular coordinat")
        namaaa = TextMobject("$\\vec{\\vec{\\tau }}$ adalah sebuah transformasi koordinat curvaliniear",color=YELLOW)
        namaa1 = TextMobject("$\\vec{x}^1 = \sqrt{(x^1 + x^2)}^2$")
        namaa2 = TextMobject("$\\vec{x}^1 = arctan (x^2/x^1)$")
        namaa3 = TextMobject("$\\vec{x}^1 = x^3$")
        namaa4 = TextMobject("$x^1 = \\vec{x} cos (\\vec{x^2})$")
        namaa5 = TextMobject("$x^2 = \\vec{x} sin (\\vec{x^2})$")
        namaa6 = TextMobject("$x^3 = \\vec{x^3}$")
        namaa.set_color_by_gradient(RED,GREEN)
        warna.scale(0.8)
        warna.set_color_by_gradient(RED,BLUE)
        warna.shift(3*DOWN)
        apatehkotakk2 = Rectangle(height = 1.3, width = 13.5)
        apatehkotakk2.set_fill(YELLOW, opacity= 1)
        apatehkotakk2.shift(3*DOWN)
        self.add_fixed_in_frame_mobjects(apatehkotakk2)
        self.remove(apatehkotakk2)
        self.play(Write(apatehkotakk2))
        self.add_fixed_in_frame_mobjects(warna)
        self.remove(warna)
        self.play(Write(warna))
        self.wait(3)
        self.add_fixed_in_frame_mobjects(namaa)
        self.remove(namaa)
        self.play(Write(namaa))
        namaa.set_color_by_gradient(RED,BLUE)
        namaa.set_color_by_gradient(RED,BLUE)
        self.wait(2)
        self.add_fixed_in_frame_mobjects(namaa)
        self.remove(namaa)
        self.add_fixed_in_frame_mobjects(namaaa)
        self.remove(namaaa)
        self.play(ReplacementTransform(namaa,namaaa),run_time=1.5)
        self.wait(2)

        namaa1.shift(1.5*UP)
        namaa2.next_to(namaa1,DOWN)
        namaa3.next_to(namaa2,DOWN)
        namaa4.shift(1.5*UP)
        namaa5.next_to(namaa4,DOWN)
        namaa6.next_to(namaa5,DOWN)
        namaateh = (VGroup(namaa1,namaa2,namaa3))
        namaateh1 = (VGroup(namaa4,namaa5,namaa6))
        namaateh.scale(1.1)
        namaateh.shift(1.5*DOWN)
        namaateh1.set_color_by_gradient(RED,BLUE)
        namaateh1.shift(1.5*DOWN)
        b_3 = Brace(namaateh, DOWN)
        b_4 = Brace(namaateh1, DOWN)
 
        tensor = TextMobject("Tc",color=(YELLOW))
        tensor1 = TextMobject("$Tc^{-1}$",color = (YELLOW))
#        namaaatt.shift(4*RIGHT)

        
             
        namaateh.set_color_by_gradient(YELLOW,PURPLE)
        namaateh1.scale(1.1)
        namaateh.set_color_by_gradient(RED,GREEN)
        self.add_fixed_in_frame_mobjects(namaaa)
        self.remove(namaaa)
        self.add_fixed_in_frame_mobjects(namaateh)
        self.remove(namaateh)
        self.play(Write(namaateh))
        self.wait()
        self.play(ApplyMethod(namaateh.move_to,2*UP+4.5*LEFT))
        self.add_fixed_in_frame_mobjects(b_3)
        self.remove(b_3)
        b_3.shift(2.75*UP+4.5*LEFT)
        self.play(Write(b_3), run_time=1.5)
        tensor.shift(0.1*DOWN+4.35*LEFT)
        tensor1.shift(0.1*DOWN+5.25*RIGHT)
               
        self.add_fixed_in_frame_mobjects(namaateh1)
        self.remove(namaateh1)
        
        self.play(Write(namaateh1))
        self.play(ApplyMethod(namaateh1.move_to,2*UP+5*RIGHT))
        
        self.add_fixed_in_frame_mobjects(tensor)
        self.remove(tensor)
        self.play(Write(tensor))
        self.wait(2)
        self.add_fixed_in_frame_mobjects(b_4)
        self.remove(b_4)
        b_4.shift(2.7*UP+5.05*RIGHT)
        self.play(Write(b_4))
        self.wait()
        self.add_fixed_in_frame_mobjects(tensor1)
        self.remove(tensor1)
        self.remove(tensor1)
        self.play(Write(tensor1))
        self.wait(3)
#TEKS #        namaaatt.shift(4*RIGHT)