(bind-func pol_to_cart
"transform a whole buffer pol->cart in-place"
(lambda (a:Complexd* n:i64)
(let ((temp:double 0.0))
(doloop (i n)
(set! temp (* (tref (pref a i) 0) (cos (tref (pref a i) 1))))
(tset! (pref-ptr a i) 1
(* (tref (pref a i) 0) (sin (tref (pref a i) 1))))
(tset! (pref-ptr a i) 0 temp))
void)))