#include "gnuplot_plugin.h" #include #include DLLEXPORT struct value sphPlm(int nargs, struct value *arg, void *p){ struct value r; int l; int m; double x; RETURN_ERROR_IF_WRONG_NARGS(r, nargs, 3); RETURN_ERROR_IF_NONNUMERIC(r, arg[0]); RETURN_ERROR_IF_NONNUMERIC(r, arg[1]); RETURN_ERROR_IF_NONNUMERIC(r, arg[2]); r.type = CMPLX; l = IVAL(arg[0]); m = IVAL(arg[1]); x = RVAL(arg[2]); r.v.cmplx_val.real = gsl_sf_legendre_sphPlm(l,m, x); r.v.cmplx_val.imag = 0.0; return r; }