Tunable beam direction and transmission of light using photonic crystal waveguide