Mathematic explanation needed for a univariate classification method based on solving a quadratic equation I read a piece of codes on classifying image hue values into three classes with derived thresholds. The thresholds are calculated by simply using a quadratic formula. The related documentations for the codes are as follows:

/*
*       (v_B - v_A)x^2 + 2(m_B*v_A - m_A*v_B)x + (m_A^2*v_B - m_B^2*v_A) = 0
*
*       v_A : variance of group A
*       m_A :   mean of group A
*       v_B : variance of group B
*       m_B :   mean of group B
*
*       Quadratic formula
*       ax^2 + bx + c = 0
*       a = v_B - v_A
*       b = 2(m_B*v_A - m_A*v_B)
*       c = (m_A^2*v_B - m_B^2*v_A)
*
*       x1 = (-b+sqrt(b^2-4ac))/2a
*       x2 = (-b-sqrt(b^2-4ac))/2a
*
*/


Here above is to find a threshold to delimit the class A and B, based on solving a quadratic equation involving the mean and variance of the two groups, and the threshold is one of the solutions (i.e., x1 and x2) depending on their signs. 

I haven't seen such a quadratic equation based classification method before. Anyone know what formal name for the method? It, on the first sight, seems to me a simplified case of quadratic discriminant analysis, but not sure about that. I need a little bit mathematic background for the method. Educate me if you know that. Thanks!
Actually, it is very straightforward to derive. 

Hint 1: where would you most likely find mean and variance used? Gaussian!

Hint 2: how would you do classification using Gaussians? Simple, you fit a Gaussian to each group and compare the PDFs of new data $x$. Even simpler, you fit a Gaussian to each group and calculate the Mahalanobis distance of $x$ to each group.



A threshold is called a threshold because at this value you cannot tell which class it is in, aka, the Mahalanobis distances to two groups equal:

$$\frac{(x-\mu_A)^2}{\sigma_A^2}=\frac{(x-\mu_B)^2}{\sigma_B^2}$$

Expanding this, you will get the quadratic formula.