本文整理汇总了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