diff --git a/calculations.cpp b/calculations.cpp index f19e9be..edbcdbb 100644 --- a/calculations.cpp +++ b/calculations.cpp @@ -588,15 +588,15 @@ double radiation_length(int z, int m){ return lr; } + double precalculated_lindhard(const Projectile &p){ double T = p.T; int z = (int)p.Z ; if(z>LS_MAX_Z)z=LS_MAX_Z; - //if(p.T &table, double xval, double *y){ double r; double lxval = log(xval)/M_LN10; - if(lxvaltable.values[table.num-1])return 0.0; - if(lxval==table.values[table.num-1])return y[table.num-1]; + if(xvaltable.values[table.num-1])return 0.0; + if(xval==table.values[table.num-1])return y[table.num-1]; int i = (int)(lxval/table.step); double linstep = table.values[i+1] - table.values[i]; double x = 1.0 - ((xval - table.values[i])/linstep);