本文整理汇总了Python中mobject.tex_mobject.TexMobject.get_left方法的典型用法代码示例。如果您正苦于以下问题:Python TexMobject.get_left方法的具体用法?Python TexMobject.get_left怎么用?Python TexMobject.get_left使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobject.tex_mobject.TexMobject
的用法示例。
在下文中一共展示了TexMobject.get_left方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show_equation
# 需要导入模块: from mobject.tex_mobject import TexMobject [as 别名]
# 或者: from mobject.tex_mobject.TexMobject import get_left [as 别名]
def show_equation(self, chopped_cycloid, ref_mob):
point2, point1 = chopped_cycloid.points[-2:]
arc, theta, vert_line, tangent_line = self.get_marks(
point1, point2
)
equation = TexMobject([
"\\sin(\\theta)",
"\\over \\sqrt{y}",
])
sin, sqrt_y = equation.split()
equation.next_to(ref_mob)
const = TexMobject(" = \\text{constant}")
const.next_to(equation)
ceil_point = np.array(point1)
ceil_point[1] = self.top[1]
brace = Brace(
Mobject(Point(point1), Point(ceil_point)),
RIGHT
)
y_mob = TexMobject("y").next_to(brace)
self.play(
GrowFromCenter(sin),
ShowCreation(arc),
GrowFromCenter(theta)
)
self.play(ShowCreation(vert_line))
self.play(ShowCreation(tangent_line))
self.dither()
self.play(
GrowFromCenter(sqrt_y),
GrowFromCenter(brace),
GrowFromCenter(y_mob)
)
self.dither()
self.play(Transform(
Point(const.get_left()), const
))
self.dither()