raycasting is where you scan each column of pixels on the x axis for a wall and if you find a wall, draw the walls height for that column according to distance away from you. so you cast 400 rays because that is the amount of pixels on the x dimension on screen. the screen width is 400x240. the fov is how big your viewing angle is usually 60 or 66 degrees and horizon is the width of the screen.