-
Notifications
You must be signed in to change notification settings - Fork 2
/
omega.c
49 lines (40 loc) · 826 Bytes
/
omega.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "headdefs.h"
real Omega0(real K, real R){
if(K != 0)
return sin(K*R) / (K*R);
else
return 1.0;
}
real Omega1(real K, real R){
if(K != 0)
return sin(K*R) / K;
else
return R;
}
real Omega2(real K, real R){
if(K != 0)
return 4.0 * M_PI * R * sin(K*R)/K;
else
return 4.0 * M_PI * Sqr(R);
}
real Omega3(real K, real R){
if(K != 0)
return (4.0 * M_PI / Cube(K)) * (sin(K*R) - K*R*cos(K*R));
else
return 4.0 * M_PI * Cube(R) / 3.0 ;
}
struct VectorComplex Omega1V(struct Vector K, real R){
real kk;
struct VectorComplex t;
kk = VLen(K);
if (kk != 0)
VSCopy(t, -1.0 * I * Omega3(kk, R) / (4.0 * M_PI * R), K);
else
VSCopy(t, 0.0, K);
return t;
}
struct VectorComplex Omega2V(struct Vector K, real R){
struct VectorComplex t;
VSCopy(t, 4.0 * M_PI * R, Omega1V(K, R));
return t;
}