class_docstr: Draws an arc between two vectors which appears circular in display space.
class_docstr_tok: ["Draws","an","arc","between","two","vectors","which","appears","circular","in","display","space","."]
code: def update_text(self):
      c = self._center
      s = self.get_size()
      angle_span = (self.theta2 - self.theta1) % 360
      angle = np.deg2rad(self.theta1 + angle_span / 2)
      r = s / 2
      if self.textposition == "inside":
          r = s / np.interp(
              angle_span, [60, 90, 135, 180], [3.3, 3.5, 3.8, 4]
          )
      self.text.xy = c + r * np.array([np.cos(angle), np.sin(angle)])
      if self.textposition == "outside":
  
          def R90(a, r, w, h):
              if a < np.arctan(h / 2 / (r + w / 2)):
                  return np.sqrt(
                      (r + w / 2) ** 2 + (np.tan(a) * (r + w / 2)) ** 2
                  )
              else:
                  c = np.sqrt((w / 2) ** 2 + (h / 2) ** 2)
                  T = np.arcsin(
                      c
                      * np.cos(np.pi / 2 - a + np.arcsin(h / 2 / c))
                      / r
                  )
                  xy = r * np.array([np.cos(a + T), np.sin(a + T)])
                  xy += np.array([w / 2, h / 2])
                  return np.sqrt(np.sum(xy**2))
  
          def R(a, r, w, h):
              aa = (a % (np.pi / 4)) * (
                  (a % (np.pi / 2)) <= np.pi / 4
              ) + (np.pi / 4 - (a % (np.pi / 4))) * (
                  (a % (np.pi / 2)) >= np.pi / 4
              )
              return R90(aa, r, *[w, h][:: int(np.sign(np.cos(2 * a)))])
  
          bbox = self.text.get_window_extent()
          X = R(angle, r, bbox.width, bbox.height)
          trans = self.ax.figure.dpi_scale_trans.inverted()
          offs = trans.transform(((X - s / 2), 0))[0] * 72
          self.text.set_position(
              [offs * np.cos(angle), offs * np.sin(angle)]
          )
  
file_path: matplotlib/galleries/examples/text_labels_and_annotations/angle_annotation.py
imports: import matplotlib.pyplot
  import numpy
  from matplotlib.patches import Arc
  from matplotlib.transforms import Bbox, IdentityTransform, TransformedBbox
label_desc: Use image node_id 11 for calling the AngleAnnotation obj's underlying member method code with example usage: obj.update_text() and returns: R90, np, np