Isosurface.QEFSolver.givens_coeffs_sym C# (CSharp) Method

givens_coeffs_sym() private method

private givens_coeffs_sym ( float a_pp, float a_pq, float a_qq, float &c, float &s ) : void
a_pp float
a_pq float
a_qq float
c float
s float
return void
        void givens_coeffs_sym(float a_pp, float a_pq, float a_qq, out float c, out float s)
        {
            if (a_pq == 0.0f)
            {
                c = 1.0f;
                s = 0.0f;
                return;
            }
            float tau = (a_qq - a_pp) / (2.0f * a_pq);
            float stt = (float)Math.Sqrt(1.0f + tau * tau);
            float tan = 1.0f / ((tau >= 0.0f) ? (tau + stt) : (tau - stt));
            c = 1.0f / (float)Math.Sqrt(1.0f + tan * tan);
            s = tan * c;
        }