The Composite Theorem of Ternary Quadratic Inequalities and its Applications