Hey,
I guess it is very easy what I am trying to do, but I don't know how...
That was my idea, but of course it doesn't work. Does someone know how to implement functions while piping an file...?
And sorry for the question, but I am not able to solve it... Thanks for any help,
Ergy
I guess it is very easy what I am trying to do, but I don't know how...
Code:
cat input.dat |awk '{
function acos(x) { return atan2(sqrt(abs(1-x*x)), x) }
function asin(x) { return atan2(x, sqrt(abs(1-x*x))) }
function pi() { return 2*asin(1);}
gamma=acos(($1*$1)/(2*$3*$1))
print gamma
}'
That was my idea, but of course it doesn't work. Does someone know how to implement functions while piping an file...?
And sorry for the question, but I am not able to solve it... Thanks for any help,
Ergy