A novel polarization state generator(PSG) is presented which can realize arbitrary state of polarization(SOP) output light.The PSG consists of a linear polarizer,a rotatable quarter-waveplate(QWP) and a rotatable half-waveplate(HWP).The operating principles and controlling algorithms for this PSG are derived through a new 2-dimensional geometry method.The experimental results show that the PSG can produce arbitrary,high accurate SOP output light.This PSG can be used in the field of testing the impact of polarization related effects on optical components and on optical fiber communication systems.