;transform a whole buffer pol->cart in-place
(bind-func pol_to_cart2
"transform a whole buffer pol->cart in-place"
(lambda (a:Complexf* n:i64)
(let ((temp:float 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)))