The article is devoted to the most narrative side of modern petrography – the definition, classification and nomenclature of petrographic structures. We suggest a mathematical formalism using the theory of quadratic forms (with a promising extension to algebraic forms of the third and fourth orders) and statistics of binary (ternary and quaternary, respectively) intergranular contacts in a polymineralic rock. It allows constructing a complete classification of petrographic structures with boundaries corresponding to Hardy – Weinberg equilibria. The algebraic expression of the petrographic structure is the canonical diagonal form of the symmetric probability matrix of binary intergranular contacts in the rock. Each petrographic structure is uniquely associated with a structural indicatrix – the central quadratic surface in n-dimensional space, where n is the number of minerals composing the rock. Structural indicatrix is an analogue of the conoscopic figure used for optical recognition of minerals. We show that the continuity of changes in the organization of rocks (i.e., the probabilities of various intergranular contacts) does not contradict a dramatic change in the structure of the rocks, neighboring within the classification. This solved the problem, which seemed insoluble to A.Harker and E.S.Fedorov. The technique was used to describe the granite structures of the Salminsky pluton (Karelia) and the Akzhailau massif (Kazakhstan) and is potentially applicable for the monotonous strata differentiation, section correlation, or wherever an unambiguous, reproducible determination of petrographic structures is needed. An important promising task of the method is to extract rocks' genetic information from the obtained data.