so the normalvector seems to be a step in the right direction, but i still dont get the right angle with which the c_trace hits the wall. the code below delivers only angles in 90° steps (90,180 and 270) and not the real angle.

var winkel=my.pan;
vec_to_angle(winkel, normal);

any ideas how to solve it?

thanks for any help