In the framework of the electrocardiography (ECG) signals, this paper describes an original approach to identify heartbeat morphologies and to detect R-wave events. The proposed approach is based on a "geometrical matching" rule evaluated using a decision function in a local moving-window procedure. The decision function is a normalized measurement of a similarity criterion comparing the windowed input signal with the reference beat-pattern into a nonlinear-curve space. A polynomial expansion model describes the reference pattern. For the curve space, an algebraic-fitting distance is built according to the canonical equation of the unit circle. The geometrical matching approach operates in two stages, i.e., training and detection ones. In the first stage, a learning-method based on genetic algorithms allows us estimating the decision function from training beat-pattern. In the second stage, a level-detection algorithm evaluates the decision function to establish the threshold of similarity between the reference pattern and the input signal. Finally, the findings for the MIT-BIH Arrhythmia Database present about 98% of sensitivity and 99% of positive predictivity for the R-waves detection, using low-order polynomial models.