The Perspective-N-Point problem (PNP) is a notable problem in computer vision. It consists in, given N points known in an object coordinate space and their projection onto the image, estimating the distance between the video camera and the set of points. By the use of an unusual formulation, we propose a method to get a strictly analytical solution based on the resolution of linear systems. This solution is quite instant to be computed and then is well adapted to real time computer vision applications. Our approach is general enough to work with a non linear sensor like a catadioptric panoramic sensor. To improve the localization accuracy, we also provide a technique to correct geometrical distortion. This algorithm also corrects little errors on intrinsic and extrinsic parameters. Well implemented, this correction can be performed in real time.