Due to the rapid advancement of quantum information theory, some concepts such as fidelity and entanglement entropy have been introduced into the study of quantum phase transitions, which can be used not only to identify novel matter phases but also to detect the critical point and describe the critical behavior of the quantum phase transitions. From the point of view of the metric space, these physical quantities can be understood as the distance between the two functions in the metric space. In this work, we study a class of quasi-periodic system represented by the generalized Aubry-André-Harper (AAH) model, by using the distance between various wavefunctions or density distribution functions in real space. The generalized AAH model, an ideal platform to understand Anderson localization and other novel quantum phenomena, provides rich phase diagrams including extended, localized, even critical (multifractal) phases and can be realized in a variety of experimental platforms. In the standard AAH model, we find that the extended and localized phases can be identified. In addition, there exists a one-to-one correspondence between two distinct distances. We are able to precisely identify the critical point and compute the critical exponent by fitting the numerical results of different system sizes. In the off-diagonal AAH model, a complete phase diagram including extended phase, localized phase, and critical phase is obtained and the distance of critical phases is intermediate between the localized phase and extended phase. Meanwhile, we apply the metric space method to the wave packet propagation and discover that depending on the phase, the distance between wave functions or density functions exhibits varying dynamical evolution behavior, which is characterized by the exponent of the power-law relationship varying with time. Finally, the distance between the state density distribution functions is proposed, and it effectively identifies distinct matter phases and critical points. The critical phase which displays a multifractal structure, when compared with the other two phases, has the large state density distribution function distance. In a word, by defining the distances of a function under different parameters, we provide not only a physical quantity to identify familiar phase transitions but also an intuitive way to identify different matter phases of unknown systems, phase transition points, and their critical behaviors.