let do_theta x y =
    let a = atan (y/.x) in
      if x > 0. then a else a+.pi