Cpolar   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/gsl.xtm

Implementation

(bind-func Cpolar
  (lambda (mag arg)
    (let ((num:gsl_complex* (alloc))
    (n (tref-ptr num 0))
    (real (* mag (cos arg)))
    (imag (* mag (sin arg))))
      (aset! n 0 real)
      (aset! n 1 real)
      num)))


Back to Index