Fractrace.Formulas.TestPoint C# (CSharp) 메소드

TestPoint() 공개 메소드

Test, if the given point is element of the difined set. Don't work with the internal formulas.
public TestPoint ( double x, double y, double z, bool inverse ) : bool
x double
y double
z double
inverse bool
리턴 bool
        public bool TestPoint(double x, double y, double z, bool inverse)
        {
            long we = -1;
            switch (old_formula)
            {
                case -2: /* Interne Formel verwenden: als Jula-Menge */
                    we = 1;
                    if (mInternFormula != null)
                    {
                        if(mInternFormula is GestaltFormula)
                        {
                            if (mInternFormula.additionalPointInfo != null)
                                mInternFormula.additionalPointInfo.Clear();
                            GestaltFormula gestaltFormula = (GestaltFormula)mInternFormula;
                            bool notinset = !gestaltFormula.GetBool(x, y, z);
                            if (notinset)
                                we = 0;
                            if (inverse) { if (we == 0) we = 1; else we = 0; }
                        }
                        else
                          we = mInternFormula.InSet(x, y, z, old_jx, old_jy, old_jz, old_jzz, old_zykl, inverse);
                    }
                    break;

                case -1: /* Interne Formel verwenden: als Mandelbrotmenge */
                    we = 1;
                    if (mInternFormula != null)
                    {
                        if (mInternFormula is GestaltFormula)
                        {
                            if (mInternFormula.additionalPointInfo != null)
                                mInternFormula.additionalPointInfo.Clear();
                            GestaltFormula gestaltFormula = (GestaltFormula)mInternFormula;
                            bool notinset = !gestaltFormula.GetBool(x, y, z);
                            if (notinset)
                                we = 0;
                            if (inverse) { if (we == 0) we = 1; else we = 0; }
                        }
                        else
                          we = mInternFormula.InSet(old_jx, old_jy, old_jz, x, y, z, old_jzz, old_zykl, inverse);
                    }
                    break;
            }

            if (we == -1)
                return false;

            if (we == 0)
                return true;

            if (we > 0 && we < old_zykl)
                return false;

            return true;
        }