9 |
|
|
10 |
|
#include "ray.h" |
11 |
|
#include "func.h" |
12 |
+ |
#include "random.h" |
13 |
|
#include "rtotypes.h" |
14 |
|
|
15 |
|
/* |
123 |
|
return(0); |
124 |
|
} |
125 |
|
wlstep = (wlmax - wlmin)/(double)MAXCSAMP; |
125 |
– |
if (wlstep*(5.*NCSAMP) < WLPART[0] - WLPART[3]) |
126 |
– |
wlstep = (WLPART[0] - WLPART[3])/(5.*NCSAMP); |
126 |
|
mf = getfunc(m, 1, 0, 0); |
127 |
|
setfunc(m, r); |
128 |
|
errno = 0; |
129 |
|
ns = (wlmax - wlmin)/wlstep + .1; |
130 |
|
wl = wlmax - .5*wlstep; |
131 |
|
for (i = ns; i-- > 0; wl -= wlstep) { |
132 |
< |
scsamp[i] = funvalue(m->oargs.sarg[0], 1, &wl); |
132 |
> |
double ws = wl + 0.9*(1.-frandom())*wlstep; |
133 |
> |
scsamp[i] = funvalue(m->oargs.sarg[0], 1, &ws); |
134 |
|
if ((errno == EDOM) | (errno == ERANGE)) { |
135 |
|
objerror(m, WARNING, "compute error"); |
136 |
|
return(0); |