{radiants to angles} conv = (180/3.141592654); {vectors norms} nl(x,y,z)=(x^2+y^2)^0.5; nn=(Nx^2+Ny^2)^0.5; {horizonthal angle N - Lh} cosa(x,y,z) = (x*Nx+y*Ny)/(nl(x,y,z)*nn); hor(x,y,z) = conv * Acos(cosa(x,y,z)); {vertical angle N - Lv} tanb(x,y,z) = z/(nl(x,y,z)*cosa(x,y,z)); ver(x,y,z) = conv * atan(tanb(x,y,z)); {angle N - L} ang(x,y,z) = conv * Acos(x*Nx+y*Ny+z*Nz); {cut off: big let light in, small prevent light to enter...} cutoff_Y = 20; cutoff_X = 20; {combined} test_combo(x,y,z) = if(cutoff_X-abs(hor(x,y,z)),if(cutoff_Y-abs(ver(x,y,z)),1/(abs(x*Nx+y*Ny+z*Nz)),0),0);