Nitrogen-vacancy(NV) centers in a bulk diamond are often employed to realize the measurement of multiple physical quantities, which depends on the orientation information of NV axis. In this paper, we report a fast and effective method to determinate the orientation of NV axis with the aid of a static magnetic field. By measuring the optically detected magnetic resonance spectra, we can precisely extract the polar angle information between the NV axis and the known magnetic field. Combining with the polar angle information of different kinds of NV centers, we employ the Nelder-Mead algorithm to get the optimal solution of the orientation of NV axis. This method is simple and effcient, which is easily applied in NV-based quantum sensing.