Gamma ray tracking arrays like AGATA and GRETA are composed of position sensitive segmented HPGe detectors. In fact the gamma interaction localization with a precision of at least 5 mm is an important step to efficiently perform the tracking. This position information is obtained with the combined use of detector electrode segmentation and Pulse Shape Analysis (PSA). In this work a generalized version of the Recursive Subtraction (RS) algorithm for 3D localization of the interactions is presented (RS_3D). The RS_3D has been applied on simulated and real signals from a 36-fold segmented AGATA asymmetric crystal, using both a calculated and an experimentally extracted signal basis.