sphbes.c

来自「Numerical Recipes Software 提供的算法子程序集」· C语言 代码 · 共 23 行

C
23
字号
#include <math.h>
#define RTPIO2 1.2533141

void sphbes(n,x,sj,sy,sjp,syp)
float *sj,*sjp,*sy,*syp,x;
int n;
{
	void bessjy();
	void nrerror();
	float factor,order,rj,rjp,ry,ryp;

	if (n < 0 || x <= 0.0) nrerror("bad arguments in sphbes");
	order=n+0.5;
	bessjy(x,order,&rj,&ry,&rjp,&ryp);
	factor=RTPIO2/sqrt(x);
	*sj=factor*rj;
	*sy=factor*ry;
	*sjp=factor*rjp-(*sj)/(2.0*x);
	*syp=factor*ryp-(*sy)/(2.0*x);
}
#undef RTPIO2
/* (C) Copr. 1986-92 Numerical Recipes Software . */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?