当前位置: 首页>>代码示例>>Python>>正文


Python TexMobject.submobjects方法代码示例

本文整理汇总了Python中mobject.tex_mobject.TexMobject.submobjects方法的典型用法代码示例。如果您正苦于以下问题:Python TexMobject.submobjects方法的具体用法?Python TexMobject.submobjects怎么用?Python TexMobject.submobjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mobject.tex_mobject.TexMobject的用法示例。


在下文中一共展示了TexMobject.submobjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_equations

# 需要导入模块: from mobject.tex_mobject import TexMobject [as 别名]
# 或者: from mobject.tex_mobject.TexMobject import submobjects [as 别名]
 def get_equations(self):
     equation1 = TexMobject([
         "\\vec{\\textbf{u}}",
         "=",
         "a",
         "\\vec{\\textbf{v}}",
         "+",
         "b",
         "\\vec{\\textbf{w}}",
     ])
     u = equation1.split()[0]
     equation1.submobjects = list(it.chain(
         [VectorizedPoint(u.get_center())],
         equation1.submobjects[1:],
         [VectorizedPoint(u.get_left())],
         [u]
     ))
     equation2 = TexMobject([
         "\\left[\\begin{array}{c} 0 \\\\ 0 \\\\ 0 \\end{array} \\right]",
         "=",
         "a",
         "\\vec{\\textbf{v}}",
         "+",
         "b",
         "\\vec{\\textbf{w}}",
         "-",
         "\\vec{\\textbf{u}}",
     ])
     equation3 = TexMobject([
         "\\vec{\\textbf{0}}",
         "=",
         "a",
         "\\vec{\\textbf{v}}",
         "+",
         "b",
         "\\vec{\\textbf{w}}",
         "-",
         "\\vec{\\textbf{u}}",
     ])
     equation4 = TexMobject([
         "\\vec{\\textbf{0}}",
         "=",
         "0",
         "\\vec{\\textbf{v}}",
         "+",
         "0",
         "\\vec{\\textbf{w}}",
         "+0",
         "\\vec{\\textbf{u}}",
     ])
     equation5 = TexMobject([
         "\\vec{\\textbf{0}}",
         "=",
         "a",
         "\\vec{\\textbf{v}}",
         "+",
         "b",
         "\\vec{\\textbf{w}}",
         "+(-1)",
         "\\vec{\\textbf{u}}",
     ])
     equation5.split()[-2].highlight(YELLOW)
     equation6 = TexMobject([
         "\\vec{\\textbf{0}}",
         "=",
         "a",
         "\\vec{\\textbf{v}}",
         "+",
         "b",
         "\\vec{\\textbf{w}}",
         "+c",
         "\\vec{\\textbf{u}}",
     ])
     result = [equation1, equation2, equation3, equation4, equation5, equation6]
     for eq in result:
         eq.split()[3].highlight(MAROON_C)
         eq.split()[6].highlight(BLUE)
         eq.split()[-1].highlight(RED_C)
         eq.scale(1.5)
         eq.shift(UP)
     return result
开发者ID:PythonJedi,项目名称:manim,代码行数:83,代码来源:chapter2.py


注:本文中的mobject.tex_mobject.TexMobject.submobjects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。