---
description: 制作大括号标注
---

# BraceAnnotation

<figure><img src="https://3378841769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvb7a7iWx8OZAGPxzbEZJ%2Fuploads%2FzUKDhcc2RuAAEA7c31ia%2FBraceAnnotation_ManimCE_v0.19.0.png?alt=media&#x26;token=fcfd6b58-5c09-497d-bfae-2e172c9b942a" alt=""><figcaption><p>BraceAnnotation</p></figcaption></figure>

```python
from manim import *

class BraceAnnotation(Scene):
    def construct(self):
        dot = Dot([-2, -1, 0])
        dot2 = Dot([2, 1, 0])
        line = Line(dot.get_center(), dot2.get_center()).set_color(ORANGE)
        b1 = Brace(line)
        b1text = b1.get_text("Horizontal distance")
        b2 = Brace(line, direction=line.copy().rotate(PI / 2).get_unit_vector())
        b2text = b2.get_tex("x-x_1")
        self.add(line, dot, dot2, b1, b2, b1text, b2text)
```
