code: def circumcenter(pt0, pt1, pt2):
      r
      a_x = pt0[0]
      a_y = pt0[1]
      b_x = pt1[0]
      b_y = pt1[1]
      c_x = pt2[0]
      c_y = pt2[1]
  
      bc_y_diff = b_y - c_y
      ca_y_diff = c_y - a_y
      ab_y_diff = a_y - b_y
      cb_x_diff = c_x - b_x
      ac_x_diff = a_x - c_x
      ba_x_diff = b_x - a_x
  
      d_div = (a_x * bc_y_diff + b_x * ca_y_diff + c_x * ab_y_diff)
  
      if d_div == 0:
          raise ZeroDivisionError
  
      d_inv = 0.5 / d_div
  
      a_mag = a_x * a_x + a_y * a_y
      b_mag = b_x * b_x + b_y * b_y
      c_mag = c_x * c_x + c_y * c_y
  
      cx = (a_mag * bc_y_diff + b_mag * ca_y_diff + c_mag * ab_y_diff) * d_inv
      cy = (a_mag * cb_x_diff + b_mag * ac_x_diff + c_mag * ba_x_diff) * d_inv
  
      return cx, cy
docs: r"""Calculate and return the circumcenter of a circumcircle generated by a given triangle.
  
      All three points must be unique or a division by zero error will be raised.
  
      Parameters
      ----------
      pt0: (x, y)
          Starting vertex of triangle
      pt1: (x, y)
          Second vertex of triangle
      pt2: (x, y)
          Final vertex of a triangle
  
      Returns
      -------
      cc: (x, y)
          circumcenter coordinates
  
      See Also
      --------
      circumcenter